Threaded View
-
23 Jan 2013 7:55 AM #1
[3.4.0] Ext.list.BooleanColumnView trueText, falseText, undefinedText are ignored
[3.4.0] Ext.list.BooleanColumnView trueText, falseText, undefinedText are ignored
REQUIRED INFORMATION
Ext version tested:- Ext 3.4.0
- FireFox
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- Ext.list.BooleanColumnView trueText, falseText, undefinedText options are ignored.
- Just run the sample script
- "YES" and "NO"
- Default "true" and "false"
Code:Ext.onReady(function () { new Ext.ListView({ renderTo: Ext.getBody(), height: 200, width: 200, store: new Ext.data.Store({ reader: new Ext.data.ArrayReader({ fields: [{ name: "test" }] }), data: [ [true], [false] ] }), columns: [{ xtype: "lvbooleancolumn", dataIndex: "test", header: "Test", falseText: "NO", trueText: "YES" }] }); });
HELPFUL INFORMATION
Possible fix:- Please see the two comments with "!!!".
Code:<script type="text/javascript"> Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, { trueText: 'true', falseText: 'false', undefinedText: ' ', constructor : function(c) { Ext.apply(this, c); // !!! added c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}'); var t = this.trueText, f = this.falseText, u = this.undefinedText; c.tpl.format = function (v) { if(v === undefined){ return u; } if(!v || v === 'false'){ return f; } return t; }; Ext.list.BooleanColumn.superclass.constructor.call(this, c); // !!! Replaced DateColumn with BooleanColumn. The superclass is the same, but just inconsistent. } }); Ext.reg('lvbooleancolumn', Ext.list.BooleanColumn); </script>
You found a bug! We've classified it as
EXTJSIII-101
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote