Skip to main content

move()

moves an item to the defined position

move(id: (string | number) | (string | number)[], index: number, target?: object): (string | number) | (string | number)[];

Parameters:

  • id: string | string[] - the ids of items to move
  • index: number - the index to move items to
  • target: object - optional, the target data collection object

Returns:

Either the item's id or an array with ids of items.

Example

component.data.move("4",5); // moves the item with id:4 to the position with index 5

Related sample: Data. Move