-
21 Oct 2010 2:43 PM #1
[OPEN-1354] 3.3.0 -> Ext.list.BooleanColumn broken
[OPEN-1354] 3.3.0 -> Ext.list.BooleanColumn broken
Hi, not much time this time, Original-Code in 3.3.0 is calling the wrong parent constructor and setting the trueText and falseText isn't working either. Don't drink and code folks :-)
Fixed code is below, fixes are in bold:
Cheers and keep up the great work :-)Code:Ext.list.BooleanColumn = Ext.extend(Ext.list.Column, { /** * @cfg {String} trueText * The string returned by the renderer when the column value is not falsey (defaults to <tt>'true'</tt>). */ trueText: 'true', /** * @cfg {String} falseText * The string returned by the renderer when the column value is falsey (but not undefined) (defaults to * <tt>'false'</tt>). */ falseText: 'false', /** * @cfg {String} undefinedText * The string returned by the renderer when the column value is undefined (defaults to <tt>' '</tt>). */ undefinedText: ' ', constructor : function(c) { Ext.apply(this, c); 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); } });
-
23 Nov 2010 3:29 PM #2
Thanks for the code, based on the other columns I think it might look more like this, so as not to call ext.apply more than once. (it is called again it the superclass)
Code:constructor : function(c) { c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}'); var t = c.trueText || this.trueText, f = c.falseText || this.falseText, u = c.undefinedText || 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); }
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[OPEN-415] Sorting a list (by dragging a line using a handle) broken in 0.96
By alikic in forum Sencha Touch 1.x: BugsReplies: 2Last Post: 6 Jan 2011, 8:29 AM -
[FIXED-409] 0.96: Carousel Switch Broken when List is Used
By don_bm in forum Sencha Touch 1.x: BugsReplies: 3Last Post: 8 Oct 2010, 7:01 AM -
[FIXED-349][3.0r5627] column resize in Ext.list.ListView broken
By Drayton in forum Ext 3.x: BugsReplies: 4Last Post: 4 Dec 2009, 1:47 PM -
Ext.grid.BooleanColumn xtype
By archmisha in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 28 Jul 2009, 9:56 AM


Reply With Quote