Help slickGrid newbie set value in column.push

47 views
Skip to first unread message

Oscar San Martin

unread,
Nov 13, 2020, 7:40:57 AM11/13/20
to SlickGrid
Hi, i'm have this code to add dynamic columns to my slickgrid:

columnsm = grid.getColumns();
columnsm.push( {id: "m" + index, name: mesa.nombre, field: "m" + index, editor: false} );
grid.setColumns(columnsm);

And work fine... but i don't know how to set values to this new column(s)....

// Navigate all rows (12)
var i = 0;
var indC = 3; // cols 0..2 have data previously loaded fine
while (i < grid.getData().length) {
         // If is valid row
         if(grid.getData()[i].nvoto !== '0'){

         while(indC < grid.getColumns().length){

         parametros = {
                                     idT : $("#cboCirceles").val(),
                                    nomM : grid.getColumns()[indC].name,
                                    nV : grid.getData()[i].nv
                                  };

           $.post("getresultados.php", parametros, function(resultados) {
                     console.log(resultados); 
                    // return valid data but how to set this value in grid(i, indC) ???
            }, 'json').promise().done(function(){

});

indC++;
}
}
i++;
}

Thanks in advance!!!!

OSM

Reply all
Reply to author
Forward
0 new messages