使用JQgrid和sortableRows.更新表格行顺序

编程入门 行业动态 更新时间:2024-10-28 10:32:56
本文介绍了使用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.更新表格行顺序

本文发布于:2023-10-23 03:35:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519638.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:顺序   表格   JQgrid   sortableRows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!