我这样写的不行
function moveTop() {
var pageData = datagrid1.getData();
var firstRow = pageData[0];
var rows = datagrid1.getSelecteds();
datagrid1.moveRow(rows, firstRow._uid);
}
function moveBottom() {
var pageData = datagrid1.getData();
var lastRow = pageData[pageData.length - 1];
var rows = datagrid1.getSelecteds();
datagrid1.moveRow(rows, lastRow._uid);
}
moveRow是移动单行的API
var row = grid.getSelected();
grid.moveRow(row, 0);
var lastRow=grid.getData()[grid.getData().length-1];
var lastIndex=grid.indexOf(lastRow);
grid.moveRow(row,lastIndex+1);