Results 1 to 2 of 2

Thread: GridPanel hbox align stretch

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default GridPanel hbox align stretch

    Attempting to present a screen from a grid where one record would occupy the complete container, two records would each occupy 50% of container and so on. Have searched the documentation and examples at
    length but your examples appear to be utilizing static data, hence cannot find an example rendering a
    grid panel incorporating "hbox" and "aligntretch" layout is well presented.

    This code is my current state of confusion and is yielding an error in Firebug to the effect "headerCtCfg is undefined". Any push in the right direction would be greatly appreciated since as you can quickly discern
    I am new to EXT.

    Code:
     Ext.define('schedule', {
          extend: 'Ext.data.Model',
          fields: [
            {name:'Spur',       type:'short'},
            {name:'CurrentTIC', type:'string'},
            {name:'PendingTIC', type:'string'},
            {name:'LastTID',    type:'string'}
          ]
        });
        
        var schedStore = Ext.create('Ext.data.Store', {
          storeId: 'schedStore', 
          model: 'schedule',
          autoLoad: true,
          proxy: {
            type: 'ajax',
            url: 'getSched.jsp',        
            extraParams: {
              busModule: module
            },        
            reader: {
              type: 'json',
              root: 'schedules',
              totalProperty: 'SchedCount'
            }        
          },
          listeners: {
            load: {            
              fn: function() {
                
                Ext.create( 'Ext.Viewport', {
                  layout: 'border',
                  items: [{                
                    region: 'center',
                    layout: 'fit',                
                    items: [{
                      xtype: 'grid',
                      store: schedStore,
                      layout: {
                        type: 'hbox',
                        align: 'stretch'
                      },
                      items: [{
                        xtype: 'gridcolumn',
                        align: 'center',
                        flex: 1,
                        dataIndex: 'Spur'
                      },{
                        xtype: 'gridcolumn',
                        align: 'center',
                        flex: 1,
                        dataIndex: 'CurrentTIC'
                      },{
                        xtype: 'gridcolumn',
                        align: 'center',
                        flex: 1,
                        dataIndex: 'PendingTIC'
                      },{
                        xtype: 'gridcolumn',
                        align: 'center',
                        flex: 1,
                        dataIndex: 'LastTID'
                      }]
                      /*
                      columns: [{
                        align    : 'center',
                        flex     : 1,
                        //sortable : false,
                        dataIndex: 'Spur'
                      },{
                        align    : 'center',
                        flex     : 1,
                        //sortable : false,
                        dataIndex: 'CurrentTIC'                  
                      },{
                        align    : 'center',
                        flex     : 1,
                        //sortable : false,          
                        dataIndex: 'PendingTIC'                  
                      },{
                        align    : 'center',
                        flex     : 1,
                        //sortable : false,
                        dataIndex: 'LastTID'                  
                      }]
                      */
                    }]
                  }]
                })
              }
            }
          }
        });
    Last edited by mitchellsimoens; 23 Feb 2012 at 8:26 AM. Reason: added [CODE] tags

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,381
    Answers
    3997
    Vote Rating
    1536
      0  

    Default

    The grid isn't meant to use hbox layout.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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