显示我的Ext.list组件有问题。这是我的代码:
Ext.define("iphone.view.customers.List", {
extend: 'Ext.List',
xtype: 'customersList',
config: {
fullscreen: true,
title: 'Customers List',
ui: 'round',
itemTpl: [ '{title}' ],
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
}
});当我启动应用程序时,控制台会产生此警告,但不会出现任何情况:
警告Ext.Loader同步加载'Ext.data.Store';考虑将'Ext.data.Store‘显式添加为相应类的要求
谢谢。
发布于 2012-05-12 10:56:34
您可以看到这种警告,因为在Sencha Touch 2中这样做的最佳实践是:
data配置定义Ext.data.Store (本例中为内联数据)listStore,然后在列表定义中使用此配置:store: listStore
希望这能有所帮助。
举一个例子来说明你的处境:
Ext.define('iphone.store.Customers', {
extend: 'Ext.data.Store',
config: {
model: 'iphone.model.Customer',
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
]
}
});并列出:
Ext.define("iphone.view.customers.List", {
extend: 'Ext.List',
xtype: 'customersList',
config: {
fullscreen: true,
title: 'Customers List',
ui: 'round',
itemTpl: [ '{title}' ],
store: 'Customers'
}
});https://stackoverflow.com/questions/10563049
复制相似问题