在extjs网格中拖放的行的顺序

Ric*_*ler 1 grid drag-and-drop extjs

我在网格中使用拖放功能,如下所示:

{
xtype: 'gridpanel',
id: 'editlinesGrid',
title: 'line',
forceFit: true,
store: 'gridEditlines',
region: 'center',
viewConfig: {
    plugins: [
    Ext.create('Ext.grid.plugin.DragDrop', {
        ptype: 'gridviewdragdrop'
    })],
    listeners: {
        drop: {
            fn: me.onGriddragdroppluginDrop,
            scope: me
        }
    }
},
columns: [{
    xtype: 'rownumberer',
    dataIndex: 'stopOrder'
}, {
    xtype: 'gridcolumn',
    dataIndex: 'stopId',
    text: 'stopId',
    field: {
        xtype: 'combobox',
        allowBlank: false,
        displayField: 'stopId',
        store: 'gridStops'
    }
},
Run Code Online (Sandbox Code Playgroud)

当我将行拖到更高或更低的位置时,我需要将新位置发送到服务.我需要发送的是:

{
"stopOrder": 1,  <-- here should be the new position in the grid
"stopDTO": {
"stopId" : 1
}
}
Run Code Online (Sandbox Code Playgroud)

这是我用于拖放的事件绑定

 onGriddragdroppluginDrop: function(node, data, overModel, dropPosition, options) {
    alert(data);
},
Run Code Online (Sandbox Code Playgroud)

如何将数据发送回服务需要做什么?

ole*_*nko 6

至于问题没有得到解答,我也花了一些时间来"找到"它,这是链接到主要的sencha doc 使用DnD重新排序网格行