I added two listeners 'check change' and 'item click' in Ext.tree.Panel. But i noticed that, when ever the check change occurs then it is also triggering item click event also. I wish to prevent this item click event.
listeners : {
checkchange: function(node, checked, eOpts){
alert('this is check change');
},
itemclick : function(obj, record, item, index, e, eOpts){
alert('this is item click');
}
}
This are the listeners in Ext tree. On check change i wish to get 'this is check change' this alert only. How it is possible ?
You can use event getTarget method to check DOM of the checkbox. The complete solution is below:
If you are clicking the checkbox to change its value the itemclick event will always fire before the checkchange event. If you dont wish for anything to happen on the itemclick event, simply dont define it (remove the listener).
Lame solution ! I was able to limit the script only to the 'itemclick'. Works well in ExtJs 5.1.1 and probably in all versions where css checkbox class name is 'x-tree-checkbox'
Have you tried to implement the 'beforeitemclick' event? it fires when you click the item, and inside this handler you can implement the checkchange.