最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Using JQgrid and sortableRows. Update table row order - Stack Overflow

programmeradmin3浏览0评论

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");} }); 

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");} }); 
Share Improve this question edited May 23, 2017 at 10:27 CommunityBot 11 silver badge asked Jul 28, 2010 at 20:10 kilrizzykilrizzy 2,9436 gold badges40 silver badges63 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

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.

发布评论

评论列表(0)

  1. 暂无评论