Use SortableRows and Know When Rows Have Been Moved

I want to use the sortableRows jqGrid property. How to determine when a row has been moved. I studied the documentation and looked for examples, but did not find much. I really believe this is something like

jQuery("#grid").sortableRows({connectWith:'#gird',
                              ondrop: function(){ alert("row moved") }});

but that will not work. I can move lines, but don't seem to catch this event. Something is wrong with my syntax or my approach in general.

Basically, I need to know that the lines have been rearranged, so I can be sure that they will be saved with their new order.

thank

+3
source share
2 answers

jqGrid uses the ui-sortable plugin to sort the rows: http://jqueryui.com/demos/sortable/ . AT

jQuery("#grid").sortableRows( options )

"options" - .

options = { update : function(e,ui){} }

- , .

+7

sortstop :

jQuery("#grid").bind('sortstop', function(event, ui) { alert("row moved") });

, .

+4

Source: https://habr.com/ru/post/1735502/


All Articles