0

i am adding data using following function

 grid.onAddNewRow.subscribe(function (e,args) {
        // code for adding data
    });

but it is called immediately after adding data in first column. i want to call this function after adding data in whole row(all columns). is there any event or any other way to call this function after adding data in last column?

Jan Hančič
  • 53,269
  • 16
  • 95
  • 99
priyanka patel
  • 617
  • 2
  • 10
  • 30

1 Answers1

0

SlickGrid works on a cell-editing model. There is no concept of editing a "row", just cells within the row. As such, how would you decide when the user has added data in the "last" column? The user could add a new row and add data in column 1, 2, 3, 5 and then in column 4. Presumably the row should only be committed after column 4 was edited, but next time it might be column 5, or column 3.

I can think of two options:

  • Use the onCellChange event and check whether data has been added to every column
  • Add an extra column to the grid with a custom formatter to display a "Commit" button in the new row. The user can click this buttonn when they have added data to the new row.
njr101
  • 9,499
  • 7
  • 39
  • 56