0
votes

Looking for an answer to a question I posted on the Sencha ExtJS forum which can be found here => http://www.sencha.com/forum/showthread.php?131351-Creating-a-grid-with-columns-generated-from-base-class-file

If anyone can help me that would be great!

Thanks

1

1 Answers

0
votes

Perhaps use constructor instead?

ConsolidationScheduleGridUi = Ext.extend(Ext.grid.GridPanel, {
  title: 'Consolidation Schedules',
  store: 'consolidationschedulestore',
  constructor: function(cfg) {
    cfg = Ext.applyIf(cfg || {}, {
      viewConfig: {
        forceFit: true
      },
      columns: [
        {
          xtype: 'gridcolumn',
          dataIndex: 'dummycolumn',
          header: 'BlankCol',
          sortable: true,
          width: 300,
          hideable: false
        }
      ]
    });
    ConsolidationScheduleGridUi.superclass.constructor.call(this, cfg);
  }
});

That way any columns specified in the cfg object will take precedence, and if you don't define any the default column will be used instead.