Using JQgrid and sortableRows. Update table row or

2019-02-20 16:50发布

Using: Using SortableRows and know when rows have been moved I have been able to call an alert after the modification of my row order.

How would I send this data to PHP/ call the editurl passing this data, similar to when adding or editing rows the editurl receives a $_POST['oper'] variable?

Currently have:

jQuery("#images_list").jqGrid('sortableRows',
                              options = { update : function(e,ui){alert("hi");} }); 

1条回答
可以哭但决不认输i
2楼-- · 2019-02-20 17:09

First of all the usage of update event should be like following:

jQuery("#images_list").jqGrid(
    'sortableRows',
    { update : function(e,ui) {
                   alert("item with id=" + ui.item[0].id + " is droped");
               }
    });

If you need other row data, you can get there using the id of the row moved and getRowData method.

How to post the results to the server you should decide yourself. You can use $.ajax function directly. I think, that changing of order of rows should not be interpret as an adding, deleting or editing of rows.

查看更多
登录 后发表回答