Check documentation for the latest version of dhtmlxSuite onBeforeAdd DHTMLX Docs

onBeforeAdd

fires before item adding is initiated

boolean onBeforeAdd(object obj, [index index] );
objobjectan object which will be added
indexindexindex, at which item will be added, optional
booleantrue - to trigger the default action, false - to block it

Example

myList.attachEvent("onBeforeAdd", function (obj, index){
    // your code here
    return true;
});

Details

the event is blockable, if the false value is returned from the custom method, the default reaction will be blocked

Back to top