easyUI datagrid 上下移动行
function datagridRowMove(e, target, isUp) {
console.log(e);
var $view = $(target).closest( ‘div.datagrid-view’);
var index = $(target).closest( ‘tr.datagrid-row’).attr(‘datagrid-row-index’ );
var $row = $view.find( ‘tr[datagrid-row-index=' + index + ']‘ );
if (isUp) {
$row.each( function () {
$( this).prev().before($( this));
});
} else {
$row.each( function () {
$( this).before($( this).next());
});
}
$row.removeClass(‘datagrid-row-over’);
e.stopPropagation();
}