• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] Grid Column default alignment?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Grid Column default alignment?

    Shouldn't the following code make all columns in the grid be align 'right' unless I specify otherwise in the buildColumns function? If so, it's not working.
    Code:
    Ext.define('Costreport.view.CostSummary', {
        extend: 'Ext.grid.Panel',
    	alias: 'widget.costsummary',
    
    	initComponent: function() {
    		var me = this;
    		Ext.apply(me, {
    			store: 'Summarys',
    			forceFit: true,
    			stripeRows: true,
    			frame: true,
    			defaults: {
    				align: 'right'     //<------------
    			},
    			columns: me.buildColumns(),
    			tbar: me.buildTbar()
    		});
    
    		me.callParent(arguments);
    	},
    	buildColumns: function() {
    		return [{
    			hidden: true,
    			dataIndex: 'GCOMP'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFSPAF'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFRVSG'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFLNTP'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFCONT'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFACCT'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFPERC'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFGRP'
    		}, {
    
    			hidden: true,
    			dataIndex: 'GFSUB'
    		}, {
    			text: '<b>Line</b>',
    			dataIndex: 'GLINE',
    			width: 4
    		}, {
    			text: '<b>Description</b>',
    			dataIndex: 'GDESC',
    			align: 'left'
    		}, {
    			text: '<b>Current Week</b>',
    			dataIndex: 'GWKAMT'
    		}, {
    			text: '<b>Cost/Unit</b>',
    			dataIndex: 'GWKCST'
    		}, {
    			text: '<b>Quantity</b>',
    			dataIndex: 'GWKQTY'
    		}, {
    			text: '<b>Current Month</b>',
    			dataIndex: 'GMOAMT'
    		}, {
    			text: '<b>Const/Unit</b>',
    			dataIndex: 'GMOCST'
    		}, {
    			text: '<b>Quantity</b>',
    			dataIndex: 'GMOQTY'
    		}, {
    			text: '<b>Current Year</b>',
    			dataIndex: 'GYRAMT'
    		}, {
    			text: '<b>Cost/Unit</b>',
    			dataIndex: 'GYRCST'
    		}, {
    			text: '<b>Quantity</b>',
    			dataIndex: 'GYRQTY'
    		}];
    	}
    });

  • #2
    Code:
    buildColumns : {
        defaults : {
            align : 'right'
        },
        items : [{
             text : 'xxx'
             dataIndex : 'abc'
    ......
    }
    http://stackoverflow.com/questions/6...umns-in-a-grid

    Comment


    • #3
      Ugh! thanks. I tried that but didn't put the items: array in for the columns...

      Comment

      Working...
      X