0
새로 만든 센차 터치 2 응용 프로그램을 기반으로. 은 그 때 나는 내 중첩 된 목록을 추가 할 - JSON에서 읽어 내 가게 인라인 또는 내 가게 - - 계층 메뉴 트리 발견 중요하지 않습니다 아무것도 탭 '메뉴'안에 표시합니다. 무엇이 잘못 되었나요?빈 중첩 된 목록 표시
중요 파일/코드 조각 :
app.js에MVC 섹션 :
// MVC
views: [
'Main'
],
models: [
'MenuItem'
],
stores: [
'MenuTree'
],
view.Main.js :
Ext.define('MobilePost.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'Ext.TitleBar',
'Ext.data.TreeStore',
'Ext.dataview.NestedList',
'Ext.data.proxy.JsonP',
'MobilePost.store.MenuTree'
],
config: {
tabBarPosition: 'bottom',
items: [
{
// From tutorial, working
title: 'Home',
iconCls: 'home',
cls: 'home',
html: [
'<img src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Welcome to Sencha Touch</h1>'
].join("")
},
{
// From tutorial, working
xtype: 'nestedlist',
title: 'Blog',
iconCls: 'star',
displayField: 'title',
store: {
type: 'tree',
fields: [
'title', 'link', 'author', 'contentSnippet', 'content',
{ name: 'leaf', defaultValue: true }
],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',
reader: {
type: 'json',
rootProperty: 'responseData.feed.entries'
}
}
},
detailCard: {
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
itemtap: function(nestedList, list, index, element, post) {
this.getDetailCard().setHtml(post.get('content'));
}
}
},
{
// Mine, not working
xtype: 'nestedlist',
title: 'Menu',
iconCls: 'settings',
store: 'MenuTree'
}
]
}
});
모델 - model.MenuItem.js :
Ext.define('MobilePost.model.MenuItem', {
extend: 'Ext.data.Model',
config: {
fields: [
'id', // Menu item id for events
'text', // Menu item text
{ name: 'leaf', defaultValue: false }
]
}
});
스토어 - STO 상점이로드 어떤 시점에서
{
"items": [
{
"id": "settings",
"text": "Settings",
"items": [
{
"id": "shift",
"text": "Working shift",
"leaf": true
},
{
"id": "users",
"text": "Operators",
"leaf": true
},
{
"id": "cash",
"text": "Cash",
"leaf": true
}
]
}
]
}
센차 아키텍트 2 m를하는 데 도움이 가게를 설정 1. 자동로드 : 필요한 저장소에 대한 진정한 전자는 문제가 무엇인지 이해합니다. 상점에 대한 2에 storeId 선언이 필요합니다. 3. nestedlist의 저장소 필드는 이전에 선언 된 storeId를 정확하게 가리켜 야합니다. 그게 전부입니다. 좋은 지원에 감사드립니다. –