1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-grid.column.Boolean'>/**
2 </span> * @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',
55 <span id='Ext-grid.column.Boolean-cfg-trueText'> /**
56 </span> * @cfg {String} trueText
57 * The string returned by the renderer when the column value is not falsey (defaults to <tt>'true'</tt>).
61 <span id='Ext-grid.column.Boolean-cfg-falseText'> /**
62 </span> * @cfg {String} falseText
63 * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
64 * <tt>'false'</tt>).
68 <span id='Ext-grid.column.Boolean-cfg-undefinedText'> /**
69 </span> * @cfg {String} undefinedText
70 * The string returned by the renderer when the column value is undefined (defaults to <tt>'&#160;'</tt>).
72 undefinedText: '&#160;',
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'){
90 });</pre></pre></body></html>