0

i have done cell editing/ row editing using row editing plugin. But for some condition i need to declare the plugin in the view's view section as

var editing = Ext.create('Ext.grid.plugin.CellEditing', {
            clicksToEdit: 2,

pluginId:'celledit'
        }); 

then use the plugin as

plugins: [
   editing
],

unfortunately i am not allowed to do this...is there any way that i can store the plugin in a variable and then use it because i have some logic for when should i activate row editing.

Mir Gulam Sarwar
  • 2,588
  • 2
  • 25
  • 39

1 Answers1

0

The plugin has enable() and disable() methods, perhaps that is what you are going to use when you need to "activate row editing". Given that the code is within initComponent, it comes to something like:

this.editing = Ext.create('Ext.grid.plugin.CellEditing', {
            clicksToEdit: 2
        });
this.editing.disable();

and then

this.plugins = [
   this.editing
];
Greendrake
  • 3,657
  • 2
  • 18
  • 24
  • OK, does `this.editing` wherever you're accessing it actually point to the plugin instance? In other words, will `this.editing instanceof Ext.grid.plugin.CellEditing` evaluate to `true`? You can also access the plugin using say `grid.getPlugin('pluginId')` – Greendrake Jun 11 '13 at 12:00
  • this is working for me var grid=Ext.getCmp('mylist'); var editor=grid.getPlugin('celledit'); – Mir Gulam Sarwar Jun 11 '13 at 13:28