Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User Mjollnir26's Avatar
    Join Date
    Oct 2008
    Location
    Germany
    Posts
    152
    Vote Rating
    0
    Mjollnir26 is on a distinguished road

      0  

    Default [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:

    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);
        }
    });
    Cheers and keep up the great work :-)

  2. #2
    Ext User
    Join Date
    Oct 2008
    Posts
    34
    Vote Rating
    0
    kjleng is on a distinguished road

      0  

    Default


    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);
        }

Similar Threads

  1. Replies: 2
    Last Post: 6 Jan 2011, 8:29 AM
  2. [FIXED-409] 0.96: Carousel Switch Broken when List is Used
    By don_bm in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 8 Oct 2010, 7:01 AM
  3. Replies: 4
    Last Post: 4 Dec 2009, 1:47 PM
  4. Ext.grid.BooleanColumn xtype
    By archmisha in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 28 Jul 2009, 9:56 AM

Thread Participants: 1