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.
  1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    977
    Vote Rating
    113
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default [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
    Browser versions tested against:
    • FireFox
    DOCTYPE tested against:
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Description:
    • Ext.list.BooleanColumnView trueText, falseText, undefinedText options are ignored.
    Steps to reproduce the problem:
    • Just run the sample script
    The result that was expected:
    • "YES" and "NO"
    The result that occurs instead:
    • Default "true" and "false"
    Test Case:

    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>
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User
    Join Date
    Sep 2009
    Location
    Denver
    Posts
    51
    Vote Rating
    2
    McQuack_82 will become famous soon enough

      0  

    Default Exists in 4.1.1gpl

    Exists in 4.1.1gpl


    I'm seeing this issue in the 4.1.1 gpl version also.

  4. #4
    Sencha User
    Join Date
    Sep 2009
    Location
    Denver
    Posts
    51
    Vote Rating
    2
    McQuack_82 will become famous soon enough

      0  

    Default temp work arround

    temp work arround


    I'm not for sure if this will fix your issue in 3.4 but in the 4.1.1. I was able to define a empty renderer and it resolved the issue. Then it was able to see the emptyCellText property on the column config.

    Code:
    {    xtype: 'booleancolumn',
       falseText: 'No',
       trueText: 'Yes',
       //Empty renderer due to bug in emptyCellText not showing correctly 
       //needed to workarround bug in framework
       renderer: function (val, record) { return val; }, 
       emptyCellText: 'Not Set'
    }

Thread Participants: 2