使用JQgrid和sortableRows.更新表格行顺序 [英] Using JQgrid and sortableRows. Update table row order

查看:753
本文介绍了使用JQgrid和sortableRows.更新表格行顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用:使用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.更新表格行顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆