PDA

View Full Version : Dynamic Grid Action Column



Supial
11 Jan 2012, 11:39 PM
Greetings,
I want to use the new Action column in ExtJS 4, however, the attributes of the Items are defined in the grids data store. For example, the "icon" attribute is defined in the data and can be different on a row-by-row basis. There are also data values which will indicate if the Action should be invoked - making it "read-only" so the icon will display, but will be greyed out via CSS.

Is this possible using the Ext.grid.column.Action component? If so how?
Can I use a "Renderer" function to define the Item's attributes?

I'm currently using a standard grid column for each action item, but want to use the new Action column which seems to be more clean.

Cheers,
Marcel

mitchellsimoens
12 Jan 2012, 8:58 AM
The renderer is hardcoded and there is no method of adding icons after. What I do is define them, use the getClass method to add a CSS class to hide (or disable) actions that you don't want for that row.

Supial
12 Jan 2012, 4:53 PM
Thanks for the reply. Using CSS for all images is not a viable option. From the sound of it, using the action column isn't going to work in this case. Is there any reason why the rendered is hardcoded and can't be used to address row-by-row configuration of the grid column? All other grid columns work this way.

Cheers,
Marcel