No 'remove' method exists in the datagrid component, please use 'deleteRow' and 'insertRow' methods instead. It is easy to extend a new method to move a row in a datagrid component.
$.extend($.fn.datagrid.methods, {
moveRow:function(jq, param){
return jq.each(function(){
var dg = $(this);
var fromRow = dg.datagrid('getRows')[param.from];
var toRow = dg.datagrid('getRows')[param.to];
dg.datagrid('deleteRow', param.from);
var toIndex = dg.datagrid('getRowIndex', toRow);
dg.datagrid('insertRow', {
index: toIndex,
row: fromRow
});
})
}
})
The code below shows how to move a row #3 to the new position #5.
$('#dg').datagrid('moveRow', {
from: 3,
to: 5
});