我想加載一個嵌套列表到我的Sencha應用程序。問題是我不熟悉它,我不知道我使用的json文件是否正確。嵌套列表不加載sencha
[
{
"text":[
{
"text":"1.1.1",
"leaf":true
}],
"text":[
{
"text":"1.1.1",
"leaf":true
}
]
}
]
這是我的商店代碼
//Defining the store for the Nested List
Ext.define('InfoImage.store.nestedListStore', {
extend: 'Ext.data.TreeStore',
requires: 'InfoImage.model.nestedListModel',
id:'nestedListStore',
config:{
//Calling the required model for the Work Item List
model : 'InfoImage.model.nestedListModel',
//Defining the proxy for the Work Item List to pull the data for the List
proxy : {
type : 'ajax',
url : 'app/model/data/list.json',
reader: {
type: 'json',
root: 'items'
}
},
autoLoad: true
}
});
和我的主要代碼
Ext.define("InfoImage.view.nestedList", {
extend:'Ext.NestedList',
xtype:'nestedList',
id:'nestedList',
config:{
fullscreen:'true',
title:'Nested List',
xtype:'nestedList',
//displayField : 'text',
html:'Nested List on its way!!!',
store:'nestedListStore'
//itemTpl:'{text}'
}
});
顯示的輸出這就是爲[對象的對象。我不知道缺少什麼。任何幫助表示讚賞。
我試過使用它,但它力度的工作。所以我評論說,如果這是正確的代碼。我無視它並再次嘗試。仍然沒有工作。 – Khush 2012-04-27 03:32:23
它會給你同樣的錯誤嗎?你能不能也發佈你的模型代碼? – 2012-04-27 04:23:12