PDA

View Full Version : Possible bug with config and title property?



mtycholaz
19 May 2011, 10:31 AM
Here's a simple demo to reproduce the issue. The expected functionality is that I should be able to pass a title into the config. A simple workaround is to set the title after the component is created.


Ext.define('MyGrid', {
extend: 'Ext.grid.Panel',
title: 'Default Panel Header',
config: {
//title: 'Default Panel Header',
renderTo: document.body,
columns: [ { header: 'Id', dataIndex: 'Id' } ],
store: new Ext.data.Store({ fields: ['Id', 'Name'], data: [ { Id:1, Name: 'Test Config'} ] })
},

constructor: function (config) {
this.initConfig(config);
this.callParent(arguments);
return this;
}
});

Ext.onReady(function () {
var g = Ext.create('MyGrid', {
//title: 'Uncomment to break the code'
});
});

jsakalos
19 May 2011, 2:11 PM
Yes, title is a problem in Ext.define, I've already seen it. If you want I can move this thread to Bugs.

mtycholaz
20 May 2011, 6:27 AM
Please and thank you.