2 * @class Ext.grid.column.Boolean
3 * @extends Ext.grid.column.Column
4 * <p>A Column definition class which renders boolean data fields. See the {@link Ext.grid.column.Column#xtype xtype}
5 * config option of {@link Ext.grid.column.Column} for more details.</p>
7 * {@img Ext.grid.column.Boolean/Ext.grid.column.Boolean.png Ext.grid.column.Boolean grid column}
10 * Ext.create('Ext.data.Store', {
11 * storeId:'sampleStore',
13 * {name: 'framework', type: 'string'},
14 * {name: 'rocks', type: 'boolean'}
17 * {"framework":"Ext JS 4", "rocks":true},
18 * {"framework":"Sencha Touch", "rocks":true},
19 * {"framework":"Ext GWT", "rocks":true},
20 * {"framework":"Other Guys", "rocks":false}
31 * Ext.create('Ext.grid.Panel', {
32 * title: 'Boolean Column Demo',
33 * store: Ext.data.StoreManager.lookup('sampleStore'),
35 * {text: 'Framework', dataIndex: 'framework', flex: 1},
37 * xtype: 'booleancolumn',
45 * renderTo: Ext.getBody()
48 * @xtype booleancolumn
50 Ext.define('Ext.grid.column.Boolean', {
51 extend: 'Ext.grid.column.Column',
52 alias: ['widget.booleancolumn'],
53 alternateClassName: 'Ext.grid.BooleanColumn',
56 * @cfg {String} trueText
57 * The string returned by the renderer when the column value is not falsey (defaults to <tt>'true'</tt>).
62 * @cfg {String} falseText
63 * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
69 * @cfg {String} undefinedText
70 * The string returned by the renderer when the column value is undefined (defaults to <tt>' '</tt>).
72 undefinedText: ' ',
74 constructor: function(cfg){
75 this.callParent(arguments);
76 var trueText = this.trueText,
77 falseText = this.falseText,
78 undefinedText = this.undefinedText;
80 this.renderer = function(value){
81 if(value === undefined){
84 if(!value || value === 'false'){