jqGrid batch save - how to get all row data in edit mode

前端 未结 1 360
清歌不尽
清歌不尽 2021-01-20 03:13

I have a jqGrid with 100+ rows that are displayed in Edit mode by default. I am trying to figure out a way to send all row data in one call to the server.

The probl

相关标签:
1条回答
  • 2021-01-20 04:10

    I can imagine me many ways to implement you requirements. I would describe you the simplest one. It consist from

    • saving of all editing rows. If you use inline editing mode then you need call saveRow for all editing rows. Because saveRow tests internally whether the row in editing and because the most rows (probably even all) are already in editing mode, you can just use getDataIDs to get array of ids of all rows and then call saveRow in the loop for every from returned id.
    • usage of getRowData without parameters or usage of getGridParam to get "data" option.
    • send the data to the server using jQuery.ajax.
    • the last step is optional. You can start editing mode for all the rows.

    I think that the above approach is not only mostly easy implemented. It's mostly save, because it works for every editing control (inclusive custom one).

    0 讨论(0)
提交回复
热议问题