1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    33
    Vote Rating
    0
    Nightwish is on a distinguished road

      0  

    Default Why are grid sort options grayed-out?

    Why are grid sort options grayed-out?


    Despite repeated efforts I've been unable to figure out why some of the columns in my grid have their sorting options (Sort Ascending, Sort Descending) grayed-out. Even if I wanted to disable them I wouldn't know where to go and do it...

    Here's my grid setup - when the grid renders, only the ID and Title columns have sorting disabled:

    Code:
        initComponent: function ()
        {
            EpisodeGrid.superclass.initComponent.call(this);
            this.configureEpisodeGrid();
        },
    
      configureEpisodeGrid: function ()
      {
        // replace the grid view config
        this.viewConfig =
        {
          emptyText: 'No episodes found.',
          forceFit: true,
          enableRowBody: true,
          narrativeMode: 'full',
          getRowClass: this.getNarrativeRowClass
        };
    
        // setup grid column model config, including the RowActions column
        this.getColumnModel().setConfig([
        {
          xtype: 'gridcolumn',
          header: 'ID',
          dataIndex: 'ID',
          width: 75,
          resizable: false,
          fixed: true,
          id: 'EpisodeID'
        }, {
          xtype: 'gridcolumn',
          header: 'Title',
          dataIndex: 'Title',
          id: 'EpisodeTitle'
        }, {
          xtype: 'gridcolumn',
          header: 'WFO',
          dataIndex: 'WFO',
          sortable: true,
          width: 75,
          hidden: true,
          resizable: false,
          fixed: true,
          id: 'WFO'
        }, {
          xtype: 'gridcolumn',
          header: 'Begin Date',
          sortable: true,
          width: 100,
          fixed: true,
          dataIndex: 'BeginDateTime',
          id: 'BeginDateTime'
        }, {
          xtype: 'gridcolumn',
          header: 'End Date',
          sortable: true,
          width: 100,
          fixed: true,
          dataIndex: 'EndDateTime',
          id: 'EndDateTime'
        }, {
          xtype: 'actioncolumn',
          header: '',
          width: 30,
          resizable: false,
          fixed: true,
          menuDisabled: true,
          items: [
          {
              iconCls: 'iconDeleteAction',
              tooltip: 'Delete Episode',
              handler: this.handleDeleteColumnClick,
              scope: this
          }]
        }]);
    
            // assign a new selection model with a single row select and add a listener
            this.selModel = new Ext.grid.RowSelectionModel({ singleSelect: true });
            this.getSelectionModel().on('rowselect', this.onEpisodeGridRowSelect, this);
    
            // add grid listeners
            this.on('rowdblclick', this.onEpisodeGridRowDblClick, this);
    
            // add EpisodeStore listeners
            this.store.on('beforeload', this.onEpisodeStoreBeforeLoad, this);
            this.store.on('datachanged', this.onEpisodeStoreDataChanged, this);
      },
    Anyone have a hint or two on what's going on here?

  2. #2
    Sencha User
    Join Date
    May 2010
    Posts
    33
    Vote Rating
    0
    Nightwish is on a distinguished road

      0  

    Default


    I found it and it almost poked out an eye: "sortable: true" needs to be explicitly defined for every grid column.

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    I did not verify, but I think you can change the default to sortable: true using this code.

    Code:
     
    Ext.grid.Column.prototype.sortable = true;

Similar Threads

  1. Removing sort options in header context menu
    By cdeguzman in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 16 Sep 2009, 12:52 AM
  2. Replies: 0
    Last Post: 26 Feb 2009, 2:09 AM
  3. Modal window greyed out on IE6
    By kerbo in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 5 Feb 2008, 9:41 AM
  4. Modal dialog completely greyed in IE
    By doc in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 3 Jun 2007, 12:09 PM
  5. BasicDialog and IE .. greyed out problem
    By alanwilliamson in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 21 Dec 2006, 4:28 AM

Thread Participants: 1