使用SortableRows并知道何时移动了行 [英] Using SortableRows and know when rows have been moved

查看:53
本文介绍了使用SortableRows并知道何时移动了行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用jqGrid的sortableRows属性.如何检测何时移动了行.我研究了文档并查找了示例,但没有发现太多.我确实相信这是

I want to take advantage of the sortableRows property of the jqGrid. How do I detect when a row has been moved. I have studied the documentation and looked for examples but haven't found much. I do believe it is something like

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

但这不起作用.我可以移动行,但似乎没有困住事件.我的语法或总体方法是否有问题.

but that does not work. I can move the rows, but don't seemed to have trapped the event. Is there something wrong with my syntax or my approach in general.

基本上,我需要知道这些行已经重新排列,因此我可以确保它们以新顺序保存.

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

谢谢

推荐答案

jqGrid使用ui-sortable插件对行进行排序:

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

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

选项"是传递给可排序插件的.

"options" is the passed to the sortable plugin.

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

是您想要的.

这篇关于使用SortableRows并知道何时移动了行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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