PDA

View Full Version : How to identify which column renderer is running for?



whalethewise
26 Sep 2011, 2:45 PM
I have a renderer function for Grid columns and and I would like to identify which column it is running for. But based on renderer description in doc

function(value, metaData, record, rowIndex, colIndex, store)

there is no reference to column itself. columnIndex is not an option because it changes when one of the columns locked.
And 'this' refers to entire panel, not to the column.

Thanks
Paul

skirtle
27 Sep 2011, 1:32 AM
columnIndex is not an option because it changes when one of the columns locked.

Does grid.columns[columnIndex] not get you the right column in these circumstances?

If that doesn't work then I guess you'll need to use a different renderer for each column. Perhaps you could use Ext.Pass to bind an identifier of your choice as the first argument passed to the renderer?

http://docs.sencha.com/ext-js/4-0/#!/api/Ext-method-pass