Skip to content

externalData

allows defining custom ‘move’ logic for the component.

let externalData: function
var dgrid = webix.grid({
// datagrid config
drag:true,
externalData: function (data, id){
data.rank = data.rank || -1;
data.title = data.title || data.value;
return data;
}
});

also check the next samples:

The property function takes 3 parameters:

  • newdata - (object) the data item to move;
  • id - (string) the item id in the source element;
  • data - (object) original data of the moved data item.

The function is called when a data item is about to be moved to the target component.

When you drag a data item to another component, it preserves its id, unless the target component contains an item with such an id. Then the item will receive a random id. The changed item is newdata. The second parameter, id, stores the initial id of the item and data stores the initial data object.