PDA

View Full Version : [OPEN EXTJSIV-2573] Ext.grid.Panel: Disable plugin



el.weilando
21 Jun 2011, 9:44 AM
Hi!

Is it possible to disable an Ext.grid.Panel-Plugin?
I want do disable the 'gridviewdragdrop'-Plugin during runtime.





this.gridDDPlugin = Ext.create('Ext.grid.plugin.DragDrop',{
ptype: 'gridviewdragdrop',
dragGroup: 'firstGridDDGroup',
dropGroup: 'firstGridDDGroup',
enableDrag: true,
enableDrop: true
});

...

this.grid = Ext.create('Ext.grid.Panel', {
renderTo: "docctnId"+this.docBoxId ,

viewConfig: {
plugins: this.gridDDPlugin,
listeners: {
drop: function(node, data, dropRec, dropPosition) {
var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';
__log("Drag from right to left", 'Dropped ' + data.records[0].get('name') + dropOn);
}
}
},



If I call this.gridDDPlugin.destory() the plugin has destroyed and an error raise while trying to drag'n'drop. But when I call this.gridDDPlugin.disable() or enable(), in console.log I can see the changes in the object, but drag'n'drop is still available in the grid.

Is this a Bug? How can I disable or enable this plugin during runtime.

jsakalos
21 Jun 2011, 9:51 AM
Looks like unimplemented. enable and disable method are inherited from AbstractPlugin and they do nothing but set/reset disabled flag. The flag is ignored by DragDrop.

Moving this thread to Bugs.

mike.estes
21 Jun 2011, 2:49 PM
Thanks for the report, got it filed as EXTJSIV-2573

byroni00
14 Jul 2011, 6:33 AM
I have a sore need to disable dragging in certain situations (not even allow the drag to start). Is there a workaround until this bug has been addressed?

Thanks,

radtad
25 Apr 2012, 5:04 PM
This still seems like a bug in 4.1 RC3. Both .enable() and .disable() do nothing on
Ext.tree.plugin.TreeViewDragDrop.