lundi 22 septembre 2014

treeviewdragdrop dragZone.onBeforeDrop event not raised to my listener

Hi,

I have a treepanel that uses the treeviewdragdrop ux.


I need to catch the "onBeforeDrag" event in order to limit draggable items to only leaf items.


I found a sample and it works fine at this fiddle using Ext JS 4.2.1.883 (I'm using ExtJs 5.x - see below):

http://ift.tt/1v2SR0N


I'm doing it differently because I'm using Architect.


I used a "View Controller Event Binding" to the "viewready" event of the treepanel.


Which created this in the treepanel:



Code:



listeners: {

viewreader: 'onTreepanelViewReady'

}



And in my Controller it created the OnTreepanelViewReady function

to which I added the following code:

Code:



onTreepanelViewReader: function (tablepanel, eOpts) {

var view = tablepanel.getView();


dd = view.findPlugin('treeviewdragdrop');


dd.dragZone.onBeforeDrag = function(data, e){
var rec = view.getRecord(e.getTarget(view.itemSelector));
return rec.isLeaf();
};


}

I was able to set a breakpoint on the onTreepanelViewReady function and verified that the dd object is present as well as dd.dragZone.onBeforeDrag. Everything is defined as expected.

However, when I set a breakpoint inside the dd.dragZone.onBeforeDrag it never gets hit.

I verified that the onBeforeDrag event is fired in the actual ux.


Does anyone have an idea why my dd.dragZone.onBeforeDrag event listener is not getting called?


Thanks!


Sencha Architect






treeviewdragdrop dragZone.onBeforeDrop event not raised to my listener

Aucun commentaire:

Enregistrer un commentaire