I found a way to do it, although it might not be the most efficient way. I have a column in my data, rank and I added an onClick function on an arrow moveOneUp(index);
function moveOneUp(rowIndex) {
_grid.dataView.getItem(rowIndex).rank = parseInt(_grid.dataView.getItem(rowIndex).rank)-1 ;
_grid.dataView.getItem(rowIndex-1).rank = parseInt(_grid.dataView.getItem(rowIndex-1).rank)+1;
_grid.dataView.fastSort('rank');
}
If anyone needs the rest of the arrow functions:
function moveOneDown(rowIndex) {
_grid.dataView.getItem(rowIndex).rank = parseInt(_grid.dataView.getItem(rowIndex).rank)+1 ;
_grid.dataView.getItem(rowIndex+1).rank = parseInt(_grid.dataView.getItem(rowIndex+1).rank)-1;
_grid.dataView.fastSort('rank');
}
function moveTop(rowIndex) {
_grid.dataView.getItem(rowIndex).rank = 0 ;
_grid.dataView.fastSort('rank');
}
function moveBottom(rowIndex) {
_grid.dataView.getItem(rowIndex).rank = parseInt(_grid.dataView.getLength())+1;
_grid.dataView.fastSort('rank');
}