4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-grid-column-Boolean'>/**
19 </span> * @class Ext.grid.column.Boolean
20 * @extends Ext.grid.column.Column
21 * <p>A Column definition class which renders boolean data fields. See the {@link Ext.grid.column.Column#xtype xtype}
22 * config option of {@link Ext.grid.column.Column} for more details.</p>
24 * {@img Ext.grid.column.Boolean/Ext.grid.column.Boolean.png Ext.grid.column.Boolean grid column}
27 * Ext.create('Ext.data.Store', {
28 * storeId:'sampleStore',
30 * {name: 'framework', type: 'string'},
31 * {name: 'rocks', type: 'boolean'}
34 * {"framework":"Ext JS 4", "rocks":true},
35 * {"framework":"Sencha Touch", "rocks":true},
36 * {"framework":"Ext GWT", "rocks":true},
37 * {"framework":"Other Guys", "rocks":false}
48 * Ext.create('Ext.grid.Panel', {
49 * title: 'Boolean Column Demo',
50 * store: Ext.data.StoreManager.lookup('sampleStore'),
52 * {text: 'Framework', dataIndex: 'framework', flex: 1},
54 * xtype: 'booleancolumn',
62 * renderTo: Ext.getBody()
65 * @xtype booleancolumn
67 Ext.define('Ext.grid.column.Boolean', {
68 extend: 'Ext.grid.column.Column',
69 alias: ['widget.booleancolumn'],
70 alternateClassName: 'Ext.grid.BooleanColumn',
72 <span id='Ext-grid-column-Boolean-cfg-trueText'> /**
73 </span> * @cfg {String} trueText
74 * The string returned by the renderer when the column value is not falsey (defaults to <tt>'true'</tt>).
78 <span id='Ext-grid-column-Boolean-cfg-falseText'> /**
79 </span> * @cfg {String} falseText
80 * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to
81 * <tt>'false'</tt>).
85 <span id='Ext-grid-column-Boolean-cfg-undefinedText'> /**
86 </span> * @cfg {String} undefinedText
87 * The string returned by the renderer when the column value is undefined (defaults to <tt>'&#160;'</tt>).
89 undefinedText: '&#160;',
91 constructor: function(cfg){
92 this.callParent(arguments);
93 var trueText = this.trueText,
94 falseText = this.falseText,
95 undefinedText = this.undefinedText;
97 this.renderer = function(value){
98 if(value === undefined){
101 if(!value || value === 'false'){