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
585
How to Insert a igGrid row?
posted

The current method .igGridUpdating("addRow", values) will add a row at the bottom of the grid. How can I insert a row at a desired location.

For example, there are 5 rows in the grid. I select a row (index=2), then click on an Insert button (in my application) to have the new grid row added in front of row index 2.  The new row is now at index 2.

Thanks.

Parents
No Data
Reply
  • 23953
    Verified Answer
    Offline posted

    Hi Erica,

     

    You can use $.ig.igDataSource.insertRow method. igGrid internally keeps a variable to $.ig.DataSource instance. You can get it with the following code: $("#grid1").data("igGrid").dataSource; Then you only need to call the insertRow method and rebind the grid.

    I've attached a sample which demonstrates this. First press the "Insert row" button and then "Rebind grid" button in order to see the record in the grid.

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.

    igGridUpdating_insertRow.zip
Children