Results 1 to 5 of 5

Thread: Grid columns not hiding

  1. #1

    Default Grid columns not hiding

    How do I get the following columns to hide? I read the documentation and I should be able to hide them with the "hidden" config option... but it's not doing it, and I don't find anything searching through the forums...

    Code:
    this.grid = new Ext.grid.GridPanel({
            store: new Ext.data.GroupingStore({
                    reader: new Ext.data.JsonReader({root: "customers", id: "ClerkId"}, [
                            {name: 'ClerkId'},
                            {name: 'CustNo'},
                            {name: 'Customer'},
                            {name: 'Address'},
                            {name: 'Postcode'},
                            {name: 'Locality'},
                            {name: 'Email'},
                            {name: 'Phone'},
                            {name: 'Fax'},
                            {name: 'Clerk'},
                            {name: 'Config'}
                    ]),
                    data: Ext.exampledata.customers,
                    sortInfo:{field: 'Customer', direction: "ASC"},
                    groupField:'CustNo'
            }),
    
            columns: [
                    {id:'ClerkId',header: "ClerkId", width: 70, sortable: true, hidden: true, dataIndex: 'ClerkId'},
                    {header: "CustNo", width: 47, sortable: true, hidden: true, dataIndex: 'CustNo'},
                    {header: "Clerk", width: 42, sortable: true, dataIndex: 'Clerk'}
            ],
    
            view: new Ext.grid.GroupingView({
                    forceFit: false,
                    groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
            }),
    
            frame: false,
            enableHdMenu : false,
            height: 250,
            sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
            collapsible: true,
            animCollapse: false,
            bodyStyle: 'border: 0;'
    });
    Would be great if someone could assist me with this, it's driving me nuts :-}

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I tested your example and it only shows one column: 'Clerk'.

    Is there anything else wrong with your code?

  3. #3

    Default

    Actually, the code is not *exactly* as above... I am creating my own widget with the GridPanel code above inside the initComponent() method... i.e.

    Code:
     Ext.Blah = Ext.extend(Ext.Panel, {
    
        initComponent : function(){
            Ext.BPCS_DropDownFormGrid.superclass.initComponent.call(this);
    
            <the code above>
    
            this.popup = new Ext.Layer({
                   shadow: this.shadow,
                   cls: [cls, this.listClass].join(' '),
                    constrain: false
            });
    
            this.popup.setWidth(700);
            this.popup.setHeight(250);
            this.grid.render(this.popup);
        }
    }
    I don't have a clue why it works for you and not me

  4. #4

    Default

    Okay, I have no bloody idea what happened or why it did not work, but now it's working :-}

  5. #5

    Default

    maybe its your cached browser information that rendered the header

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •