Results 1 to 2 of 2

Thread: Controlling Grid Column Widths

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Location
    Washington, DC
    Posts
    78

    Default Controlling Grid Column Widths

    I know the title seems simple. I myself feel like this should be a simple thing but somehow when I'm adding (or deleting) a width to columns in one of my grids it's doing absolutely nothing to adjust the column size.

    The grid is created in a component thusly
    Code:
    {
                                height:279,
                                xtype:"manager",
                                id: "manager",
                                tools: [
                                    {
                                        id:'help',
                                        qtip: 'help',
                                        handler:showWebHelpCallback("manager.htm")
                                    }
                                ],
                                cls: "southArea",
                                region: "south",
                                split: false,
                                collapsible: true,
                                title: "Manager",
                                header: true,
                                hidden: hideRightCol,
                                plugins: new Ext.ux.collapsedPanelTitlePlugin(),
                                margins: {bottom: 49}
                            }
    With the manager grid just simply
    Code:
    ns.Manager = Ext.extend(GridPanel, {
            store: store,
            stateId: 'managerState',
            colModel: new Ext.grid.ColumnModel({
    //            defaultSortable: false,
                columns: [{
                    id: 'id',
                    header: "Name",
    //                width: 0,
                    menuDisabled: true,
                    dataIndex: Ext.ensible.cal.EventMappings.ApplicationId.name
                }, {
                    id: 'date',
                    header: "Date",
    //                width: 0,
                    menuDisabled: true,
                    css: "padding-left: 13px;",
                    renderer: Ext.util.Format.dateRenderer('l m/d/Y'),
                    dataIndex: Ext.ensible.cal.EventMappings.StartDate.name
                }, {
                    id: 'waitListedOn',
                    header: "Waitlisted On",
    //                width: 0,
                    menuDisabled: true,
                    dataIndex: Ext.ensible.cal.EventMappings.CreatedDate.name
                }, {
                    id: 'groupingByNameColumn',
                    header: "GroupingBy Column",
    //                width: 0,
                    dataIndex: Ext.ensible.cal.EventMappings.GroupingByNameId.name,
                    hidden: true
                }, {
                    id: 'scheduledFor',
                    header: "Scheduled For",
    //                width: 0,
                    menuDisabled: true,
                    dataIndex: Ext.ensible.cal.EventMappings.OtherScheduledDays.name
                },
                {
                    id: 'unassignedFor',
                    header: "unassigned For",
    //                width: 0,
                    menuDisabled: true,
                    dataIndex: Ext.ensible.cal.EventMappings.OtherUnassignedDays.name
                }]
            })
    You'll notice that I commented out the width values and still no dice. Any ideas on what could be preventing the adjustment of the column widths?

  2. #2
    Sencha User
    Join Date
    Jul 2010
    Location
    Washington, DC
    Posts
    78

    Default

    SOLUTION: Solution for those of you wondering if you read this.
    Code:
    stateId: 'managerState'
    This little piece here maintains the state of the grid column widths in the case that columns are adjustable. Because of this the code that I wrote was getting overridden by the stored columns widths as dictated by the state.

Posting Permissions

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