PDA

View Full Version : [FIXED-202] grid rendering wrong xtype in colModel (auto columns broken)



Dan Ellison
26 Aug 2010, 6:24 AM
In a effort to learn to use the designer I have attempted to implement one of the standard examples, Paging Grid, via the designer interface. I create a JsonStore which is correctly coded by the designer to produce the following code:


ExtForum = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
ExtForum.superclass.constructor.call(this, Ext.apply({
storeId: 'ExtForum',
root: 'topics',
idProperty: 'threadid',
totalProperty: 'totalCount',
remoteSort: true,
fields: [
{
name: 'title'
},
{
name: 'forumtitle'
},
{
name: 'forumid'
},
{
name: 'author'
},
{
name: 'replycount',
type: 'int'
},
{
name: 'lastpost',
type: 'date',
dateFormat: 'timestamp'
},
{
name: 'lastposter'
},
{
name: 'excerpt'
}
]
}, cfg));
}
});
new ExtForum();

This code is correct. However, when designer maps the fields to the colModel I end up with the column xtype being "off by 1". The following code is what designer generates:


columns: [
{
xtype: 'gridcolumn',
dataIndex: 'title',
header: 'Title',
sortable: true,
width: 420,
editable: false,
id: 'topic'
},
{
xtype: 'numbercolumn',
dataIndex: 'author',
header: 'Author',
sortable: true,
width: 100,
align: 'right',
hidden: true
},
{
xtype: 'datecolumn',
dataIndex: 'replycount',
header: 'Replies',
sortable: true,
width: 70,
align: 'right',
editable: false
},
{
xtype: 'gridcolumn',
header: 'Last Post',
sortable: true,
width: 150,
dataIndex: 'lastpost',
id: 'last'
}
]


The xtype order that should have been created is gridcolumn, gridcolumn, numbercolumn, datecolumn. Looks like an off by 1 error but could be a problem with my approach I guess. Regardless, the resulting output is wrong. I have attached the .xds that will reproduce the error.

Any insight or suggestions much appreciated,
Dan

jarrednicholls
30 Aug 2010, 6:34 AM
Thanks Dan, the Auto Columns feature is a known bug and is already an open ticket #202. Thanks for reporting this.