fires before adding an item to the datastore
id | string|number | the ID of the newly added data item |
obj | object | data for the new item |
index | number | the index, at which the new item will be added |
boolean | false, if the operation needs to be cancelled |
view.data.attachEvent("onBeforeAdd", function(id, obj, index){
if (obj.text == "")
return false;
});
Returning false from the event handler will block further processing, and the item will not be added.