使用:使用SortableRows并知道何时移动了行修改行顺序后,我已经可以发出警报了.
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.
我如何将这些数据发送到PHP/调用传递此数据的editurl,类似于添加或编辑行时editurl接收到$ _POST ['oper']变量?
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?
当前拥有:
jQuery("#images_list").jqGrid('sortableRows', options = { update : function(e,ui){alert("hi");} });推荐答案
首先,update事件的用法如下:
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"); } });如果需要其他行数据,则可以使用移动的行的ID和getRowData方法到达那里.
If you need other row data, you can get there using the id of the row moved and getRowData method.
如何将结果发布到服务器,您应该自行决定.您可以直接使用$.ajax函数.我认为,行顺序的更改不应解释为添加,删除或编辑行.
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.
更多推荐
使用JQgrid和sortableRows.更新表格行顺序
发布评论