Skip to content

move

moves the specified item to a new position

function move(
// the ID of the item to move
sid: string,
// a new position of the item (a new index)
tindex: number,
// the object that the item is moved to
tobj?: WebixDataMoveTarget,
// extra parameters for moving
details?: WebixDataMoveOptions
): string

string a new item ID

// moving in the same grid
grid.move("a12", 0);
grid.move("a13", -1);
// moves an item to a different grid
var id = grid.move("a13", 0, grid2, {newId:"b13"});

The details object can contain the following properties:

details = {};
details.newId = "123"; // a new ID for the moved item

Note that in case newId is not defined, the new ID will be the same as the ID of the source item (sid).