Я пытаюсь загрузить вложенный список в мое приложение 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
Это дает вам такую же ошибку? Можете ли вы также опубликовать код для своей модели? –