Frewland
24 Sep 2012, 11:51 PM
I created a trivial ST2 app in Architect 2.1 using one DataView with useComponents : true
Ext.define('MyApp.view.MyDataView', {
extend: 'Ext.dataview.DataView',
config: {
defaultType: 'mydataitem',
store: 'MyDirectStore',
useComponents: true,
itemConfig: {
xtype: 'mydataitem'
}
}
});
and linked it to a trivial DataItem
Ext.define('MyApp.view.MyDataItem', {
extend: 'Ext.dataview.component.DataItem'
config: {
padding: 10,
layout: {
type: 'hbox'
},
items: [
{
xtype: 'component',
flex: 1,
html: 'here'
}
]
},
updateRecord: function(record) {
// Provide an implementation to update this container's child items
}
});
But I can only get this to work if I hand edit MyDataItem and put this line
xtype: 'mydataitem',
in front of the config. Otherwise when I run it I get the error
Uncaught Error: [ERROR][Ext.Container#setDefaultType] Invalid defaultType of: 'mydataitem', must be a valid component xtype
Sencha Architect 2.1 won't let me put the xtype in. If I try it says
A custom config cannot override a reserved config...
However, if I hand edit the xtype property into MyDataItem, Sencha Architect removes whenever I save the project.
What should I do ?
Ext.define('MyApp.view.MyDataView', {
extend: 'Ext.dataview.DataView',
config: {
defaultType: 'mydataitem',
store: 'MyDirectStore',
useComponents: true,
itemConfig: {
xtype: 'mydataitem'
}
}
});
and linked it to a trivial DataItem
Ext.define('MyApp.view.MyDataItem', {
extend: 'Ext.dataview.component.DataItem'
config: {
padding: 10,
layout: {
type: 'hbox'
},
items: [
{
xtype: 'component',
flex: 1,
html: 'here'
}
]
},
updateRecord: function(record) {
// Provide an implementation to update this container's child items
}
});
But I can only get this to work if I hand edit MyDataItem and put this line
xtype: 'mydataitem',
in front of the config. Otherwise when I run it I get the error
Uncaught Error: [ERROR][Ext.Container#setDefaultType] Invalid defaultType of: 'mydataitem', must be a valid component xtype
Sencha Architect 2.1 won't let me put the xtype in. If I try it says
A custom config cannot override a reserved config...
However, if I hand edit the xtype property into MyDataItem, Sencha Architect removes whenever I save the project.
What should I do ?