Hi,
I want to dynamically add rows to the grid using Javascript. In my grid, the column types will not be defined and only Cell types will be defined. that is for ex, the grid will be like this
Column A
Column B
Column C
…
Column A Value
…
12.00
How can i add rows in this case. I will be defining the grid values from the database. so i cant hard code in the add rows function. Is there by any means, i could copy the structure of the last row and have the same for the new row?
Is there by any means, i could copy the structure of the last row and have the same for the new row?
Not very simple, but possible
grid.addRow(new_id,"",-1); //adding new row
for (var i=0; i<grid.getColumnCount(); i++){ // set types for each column in newly added row
var type=grid.cells2(0,i).cell._cellType; // here 0 - index of row , from which types will be copied
grid.setCellExcellType(new_id,i,type);
}