Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
I Need Help Understading igtbl_addNew
posted

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.

 

Parents
  • 335
    Suggested Answer
    posted

    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.

     

     

Reply Children
No Data