PDA

View Full Version : Bug: xtype: booleancolumn renderer Function Not Being Called



billtricarico
29 Jun 2012, 2:07 PM
Hello,

In ExtJS 4.1.1 RC2, I have this booleancolumn and the renderer function is not being called:


{ xtype: 'booleancolumn',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
return 'foo';
},
draggable: false,
sortable: false,
dataIndex: 'InputParameter',
flex: 1,
hideable: false,
text: 'Input'
}

Thanks.

evant
29 Jun 2012, 3:40 PM
The purpose of using a <foo>column is to provide a renderer. If you're supplying your own, then just use a normal column.

sword-it
29 Jun 2012, 10:22 PM
Hi billtricarico,
Try this code it will work for you for xtype:'booleancolumn'



Ext.create('Ext.data.Store', {
storeId:'sampleStore',
fields:[
{name: 'framework', type: 'string'},
{name: 'rocks', type: 'boolean'}
],
data:{'items':[
{ 'framework': "Ext JS 4", 'rocks': true },
{ 'framework': "Sencha Touch", 'rocks': true },
{ 'framework': "Ext GWT", 'rocks': true },
{ 'framework': "Other Guys", 'rocks': false }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});

Ext.create('Ext.grid.Panel', {
title: 'Boolean Column Demo',
store: Ext.data.StoreManager.lookup('sampleStore'),
columns: [
{ text: 'Framework', dataIndex: 'framework', flex: 1 },
{
xtype: 'booleancolumn',
text: 'Input',
renderer: function(value, metaData, record, rowIndex, colIndex, store, view) {
return 'foo';
},
trueText: 'Yes',
falseText: 'No',
dataIndex: 'rocks'
}
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});