azuroff
9 Feb 2012, 2:24 PM
I added the TreeViewDragDrop plugin to a tree view and created event listeners for the "drop" and "beforedrop" events.
The code gets written out with the listeners: {} as part of the plugin config, like this:
Ext.applyIf(me, {
viewConfig: {
plugins: [
Ext.create('Ext.tree.plugin.TreeViewDragDrop', {
dropGroup: 'treeDDGroup',
enableDrag: false,
listeners: {
beforedrop: {
fn: me.onTreedragdroppluginBeforeDrop,
scope: me
},
drop: {
fn: me.onTreedragdroppluginDrop,
scope: me
}
}
})
]
}
})
However, the listeners: {} should be part of the viewConfig object instead -
Ext.applyIf(me, {
viewConfig: {
plugins: [
Ext.create('Ext.tree.plugin.TreeViewDragDrop', {
dropGroup: 'treeDDGroup',
enableDrag: false,
})
],
listeners: {
beforedrop: {
fn: me.onTreedragdroppluginBeforeDrop,
scope: me
},
drop: {
fn: me.onTreedragdroppluginDrop,
scope: me
}
}
}
});
As deployed by Designer, the event handlers never fire. If I manually move the listeners: {} config to the correct place, they do fire.
The code gets written out with the listeners: {} as part of the plugin config, like this:
Ext.applyIf(me, {
viewConfig: {
plugins: [
Ext.create('Ext.tree.plugin.TreeViewDragDrop', {
dropGroup: 'treeDDGroup',
enableDrag: false,
listeners: {
beforedrop: {
fn: me.onTreedragdroppluginBeforeDrop,
scope: me
},
drop: {
fn: me.onTreedragdroppluginDrop,
scope: me
}
}
})
]
}
})
However, the listeners: {} should be part of the viewConfig object instead -
Ext.applyIf(me, {
viewConfig: {
plugins: [
Ext.create('Ext.tree.plugin.TreeViewDragDrop', {
dropGroup: 'treeDDGroup',
enableDrag: false,
})
],
listeners: {
beforedrop: {
fn: me.onTreedragdroppluginBeforeDrop,
scope: me
},
drop: {
fn: me.onTreedragdroppluginDrop,
scope: me
}
}
}
});
As deployed by Designer, the event handlers never fire. If I manually move the listeners: {} config to the correct place, they do fire.