PDA

View Full Version : How can restrict the drag & drop only if tree node is leaf in EXTJS 4.2.1



eliecerSR
12 Mar 2014, 12:52 PM
I need only drag and&drop them only if tree node is leaf in EXTJS.

slemmon
17 Mar 2014, 10:46 PM
After the viewready event of the tree you'll need to set an onBeforeDrag method on the dragdrop plugin's dragZone like in the example below. You'll get the record using the event passed to the onBeforeDrag event and using the record's isLeaf() method determine if you'll return true or false in the onBeforeDrag.

4ao