PDA

View Full Version : Rendering a CheckBox in a GridPanel



billtricarico
29 Jun 2012, 2:36 PM
Hello,

I am trying to override renderer in a gridcolumn (since booleancolumn isn't working for me) to show a checkbox like the CheckBoxSelectionModel, but I am having no luck. This is my column:


{ xtype: 'gridcolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {


var cssPrefix = Ext.baseCSSPrefix;
var cls = [cssPrefix + 'grid-checkheader'];


if (value) {
cls.push(cssPrefix + 'grid-checkheader-checked');
}


return '<div class="' + cls.join(' ') + '">&#160;</div>';
},
draggable: false,
sortable: false,
dataIndex: 'InputParameter',
flex: 1,
hideable: false,
text: 'Input'
}

The renderer fires, but the resulting div tag does not show a checkbox on the grid.
This is ExtJS 4.1.1 RC2.

Thanks.

scottmartin
29 Jun 2012, 3:20 PM
Have you tried using the checkcolumn?
Ext.ux.CheckColumn

/examples/ux/CheckColumn.js

Regards,
Scott.

Romick
2 Jul 2012, 3:24 AM
Did you have an images for this css?
('grid-checkheader', 'grid-checkheader-checked')