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