I've been seeing a common theme in all client side inserts and I'm trying to understand it.
Take this code for example:
var row = igtbl_addNew(grid.Id, bandIndex);
if (grid.Rows.length-1 >= index)
{
grid.Rows.remove(grid.Rows.length-1);
grid.Rows.insert(row, index);
}
Why are we removing the last row of the grid everytime before the insert?
And what exactly is igtbl_addNew(grid.Id, 0) doing?
Can someone explain exactly what's going on here?
Thanks.
Gotcha - makes sense.
Thanks for the clarification.
The whole concept behind this is: Inserting a new row at desired location at specific index.
The igtbl_addNew can only append the new row at the end.
And use grid.Rows.insert can only insert previously removed rows.
So with the combination of both we can insert a new row at desired index.