【发布时间】:2012-02-17 01:28:30
【问题描述】:
我有一个简单的 MVC Sencha Touch 应用程序,有 1 个商店、2 个模型和 2 个视图 - 一个工具栏和一个列表。我的工具栏渲染得很好,但列表没有。没有抛出异常,我找不到我做错了什么。
商店(Books.js):
Ext.define('App.store.Books', {
extend: 'Ext.data.Store',
model: 'App.model.Book',
autoLoad: true,
data: [
{ id: '1', name: '1984', publisher: 'Orwell' },
{ id: '2', name: 'Biography', publisher: 'abcde' },
{ id: '3', name: 'The Old Man and the Sea', publisher: 'Hemingway' }
]
});
视图(List.js - 我有另一个 Bar.js 渲染良好):
Ext.define('App.view.List', {
extend: 'Ext.List',
store : 'Books',
xtype : 'mylist',
itemTpl: '<div><strong>Name: {name}</strong>Publisher: {publisher}</div>'
});
视口 (Viewport.js) - 扩展了 Ext.Container,正如我在几个示例中看到的那样:
Ext.define('App.view.Viewport', {
extend: 'Ext.Container',
requires : [
'App.view.Bar',
'App.view.List'
],
config: {
fullscreen: true,
layout: 'fit',
items: [
{
xtype : 'toolbar',
docked: 'top'
},
{
xtype: 'mylist'
}
]
}
});
正如我所写 - 显示了我的工具栏,但没有显示我的列表('mylist')。 我错过了什么或做错了什么?
谢谢
【问题讨论】:
标签: extjs sencha-touch