Hybrid View

    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
    679
    Vote Rating
    62
    Daniil is a jewel in the rough Daniil is a jewel in the rough Daniil is a jewel in the rough Daniil is a jewel in the rough

      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
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


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