4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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> * A Column definition class which renders boolean data fields. See the {@link Ext.grid.column.Column#xtype xtype}
20 * config option of {@link Ext.grid.column.Column} for more details.
23 * Ext.create('Ext.data.Store', {
24 * storeId:'sampleStore',
26 * {name: 'framework', type: 'string'},
27 * {name: 'rocks', type: 'boolean'}
30 * { 'framework': "Ext JS 4", 'rocks': true },
31 * { 'framework': "Sencha Touch", 'rocks': true },
32 * { 'framework': "Ext GWT", 'rocks': true },
33 * { 'framework': "Other Guys", 'rocks': false }
44 * Ext.create('Ext.grid.Panel', {
45 * title: 'Boolean Column Demo',
46 * store: Ext.data.StoreManager.lookup('sampleStore'),
48 * { text: 'Framework', dataIndex: 'framework', flex: 1 },
50 * xtype: 'booleancolumn',
59 * renderTo: Ext.getBody()
62 Ext.define('Ext.grid.column.Boolean', {
63 extend: 'Ext.grid.column.Column',
64 alias: ['widget.booleancolumn'],
65 alternateClassName: 'Ext.grid.BooleanColumn',
67 <span id='Ext-grid-column-Boolean-cfg-trueText'> /**
68 </span> * @cfg {String} trueText
69 * The string returned by the renderer when the column value is not falsey.
73 <span id='Ext-grid-column-Boolean-cfg-falseText'> /**
74 </span> * @cfg {String} falseText
75 * The string returned by the renderer when the column value is falsey (but not undefined).
79 <span id='Ext-grid-column-Boolean-cfg-undefinedText'> /**
80 </span> * @cfg {String} undefinedText
81 * The string returned by the renderer when the column value is undefined.
83 undefinedText: '&#160;',
85 constructor: function(cfg){
86 this.callParent(arguments);
87 var trueText = this.trueText,
88 falseText = this.falseText,
89 undefinedText = this.undefinedText;
91 this.renderer = function(value){
92 if(value === undefined){
95 if(!value || value === 'false'){