View Full Version : Checkbox only renders occasionally

30 Jun 2010, 11:59 AM
Hey guys,

I coded this, thinking it was fairly simple. But while testing I came across the checkbox issue. The renderer for checkbox does not execute for all edits. I double-checked by adding an alert statement in the render function. Here's the code:

function checkrender(value) {
return '<input type="checkbox" value="' + value + '">';

grid = new Ext.grid.EditorGridPanel({
autoHeight: true,
region: 'center',
clicksToEdit: 1,
store: store,
cm: new Ext.grid.ColumnModel({
defaultSortable: false,
columns: [
{dataIndex: 'name', editable: false, width: 180 ,menuDisabled: true},
{dataIndex: 'phone_number', editable: false} ,
{id:'index',dataIndex:'index',renderer:vRenderer,editor: indexCombo},
{id:'bool',dataIndex: 'data', width:40,editor: new Ext.grid.GridEditor(new Ext.form.Checkbox()),renderer: checkrender}
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
tbar: new Ext.Toolbar({

checkrender gets executed only sometimes. It's a hit/miss as far as I observed. Any ideas?

4 Jul 2010, 8:34 AM
Perhaps you should properly close your input element?

return '<input type="checkbox" value="' + value + '" />';