Hi Andrzej,
Thanks for using Syncfusion products.
Query: check: 'checkCallback' // <- NEVER fired - strange way of binding callbacks
We would like to let you know that, there is no event in Treeview component as “check”. In the above code instead of specifying the event name as “nodeCheck” it is used as “check”. Please change it to “nodeCheck” and the event will fire properly.
We can also bind the events attach its callback function, on the event declaration itself. Please refer the below code
[Script]
//callback function attached on the event declaration itself var myTree = $('#treeDiv').ejTreeView({ fields: { id: "id", parentId: "pid", text: "name", hasChild: "hasChild", dataSource: outlookicons, expanded: "expanded" }, allowEditing: true, allowDragAndDrop: true, nodeCheck: function (args) { alert("Check event trigerred"); } });
|
Query: Does Syncfusion components support standard way of binding to the events?
Yes, Syncfusion components support standard structure for binding the events as like binding the jQuery events. Please refer the below code,
[Script]
//standard structure for binding events as like binding jQuery events //while using this structure, the event name has to be specified in the format "pluginname" + "corresponding event name" //Here in "ejTreeViewnodeCheck" ejTreeView is the plugin name and nodeCheck is the event name $("#treeView").on('ejTreeViewnodeCheck', function () { alert("Checkbox Checked"); });
|
For your convenience, we have attached a sample in the following location to exhibit the above behavior. Please download the sample from the following location
Sample Location : Treeview Sample
Please let us know if you have further queries
Regards,
HariKrishnan