PDA

View Full Version : xtype: 'booleancolumn' - DB-fields are not filled => BooleanColum shows false



gipsomat
10 Feb 2011, 6:54 AM
Dear all

There is a problem with my BooleanColumn:

I use

xtype: 'booleancolumn', trueText: 'true', falseText: 'false'

but when a DB-field is not filled, the shown value is 'false'. I need to display an empty field!

please help...

best regards

Thomas

Bruno0226
10 May 2011, 9:48 AM
Use normal column not booleancolumn:


//xtype : 'booleancolumn',
header : String.format('{0}', 'XXX'),
dataIndex : 'T0_XXX',
width : 40,
renderer : function(value, cell){
if (value == ''){
value = String.format('<span style="color:black;">{0}</span>', '')
}else if (value == 'true'){
value = String.format('<span style="color:green;">{0}</span>', 'true')
}else if (value == 'false'){
value = String.format('<span style="color:red;">{0}</span>', 'false')
}

return value;
},
//trueText : String.format('<span style="color:green;">{0}</span>', 'true'),
//falseText : String.format('<span style="color:red;">{0}</span>', 'false'),
align : 'center',
sortable : true,
editor : {
xtype: 'checkbox'
}
now you must change the type from bool to string, in store:


//{name: 'T0_XXX', type: 'bool', mapping: 'xxx'},
{name: 'T0_XXX', type: 'string', mapping: 'xxx'},
Gab