PDA

View Full Version : Checkbox column renderer doesn't seem to work



pludikhu
19 Aug 2010, 9:44 AM
Hi

I have a GridPanel with a booleancolumn something like (simplified code to show all involved which I think may be relevant):


var grid = new Ext.grid.GridPanel({
...
cm: new Ext.grid.ColumnModel({
defaults: {width: 90,sortable: true},
columns: [
{header: 'Header',dataIndex:'neemtdeel',editor:{xtype:'checkbox'},renderer: function(){alert('Hi');},width:50,xtype:'booleancolumn'},
... // other columns
]
}),
plugins:[new Ext.ux.grid.RowEditor({cancelText: 'Annuleren',saveText: 'Bewaren'})],
sm = new Ext.grid.RowSelectionModel(),
...


But whatever I try, the renderer function never seems to fire (I also tried console.info).

The renderers seem to work for other column types, but not for boolean although as far as I can tell, it's documented.
What I'm trying to do, by the way, is not only use trueText and falseText (not showing for simplicity) but to have a class which sets the complete cell green or red to have a real visual effect.

All help appreciated!

Patrick

Condor
19 Aug 2010, 11:20 AM
Why would you want to specify your column as booleancolumn and define a renderer?

Having a default renderer is the only thing that differentiates booleancolumn from a normal gridcolumn.

ps. Wouldn't you rather use a Ext.ux.grid.CheckColumn?

pludikhu
19 Aug 2010, 11:50 AM
Worst thing, sometimes it is ;-)

I tried a lot, but not to remove the xtype completely!
You're a champ Condor!
B.t.w. I also use your grid addField and it works like a charm.


Why not use Ext.ux.grid.CheckColumn? Well, I'm not sure; I'm using the row editor for other columns too and for some reason I had the impression both somehow do the same thing. Is that a wrong assumption or did I choose the wrong one for the job?!

Can I ever thank you enough for your efforts in answering all these questions?
Very much appreciated!!!

Patrick