PDA

View Full Version : Reference to cellediting plugin is undefined when using a grid with locking columns



luisfb
14 Apr 2013, 4:52 AM
REQUIRED INFORMATION




Ext version tested:

Ext 4.2.0.663
Ext 4.1.1



Browser versions tested against:

FF 20.0.1 (firebug 1.11.2 installed)



DOCTYPE tested against:

<!DOCTYPE html>



Description:

When creating a grid with at least one column with property locked: true and cellediting plugin, I tried to get the cellediting plugin with grid.getPlugin("pluginID"); and it returns undefined. The grid object also has its property plugins undefined. This bug doesn't happens when I don't use the locked: true in the grid's columns.



Steps to reproduce the problem:

Just create a grid with cellediting plugin and with one of its columns as locked: true



The result that was expected:

The property plugins of the grid object should not be null and it should be possible to get the plugin via grid.getPlugin("pluginID");



The result that occurs instead:

The described above



HELPFUL INFORMATION


Debugging already done:

none



Possible fix:

I think it is something related to plugin.lockableScope



Additional CSS used:

only default ext-all.css in version 4.1.1.
I used neptune theme in 4.2.0.663



Operating System:

Windows 7

mankz
14 Apr 2013, 6:08 AM
Not a bug, when you use a locked grid it actually creates 2 child grids which get their own copy of the plugins you pass to the 'top' grid (which only acts as a container).

Note also that there is no plugins property that you should rely on. Docs here: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.Panel

You can still get the plugin from the child grids using grid.lockedGrid, or grid.normalGrid.

luisfb
14 Apr 2013, 1:43 PM
I considered it a bug because there is no info about the properties lockedGrid and normalGrid in documentation.
Maybe the appropriated approach should refactor the method getPlugin to return an array of cellediting plugins in case of a grid with locking feature.
And as I shouldn't rely on the property plugins of my grid objetc, I shouldn't use the properties lockedGrid and normalGrid directly either.

Thank you.

mankz
14 Apr 2013, 1:46 PM
Right, lockedGrid/normalGrid should definitely be documented so that I'd call a docs bug too.