背景:我正在使用列表并存储列表配置。我每次都在进行 Ajax 调用并在列表中显示数据。现在,我想使用本地存储代理。
这是我的代码,
xtype : 'list',
id : 'namesList',
store : {
id : 'namesStore',
autoLoad : true,
fields : ['text', 'value'],
proxy : {
type:'ajax',
url : 'dataFolder/namesList.json',
reader : {
type : 'json',
rootProperty : 'record'
}
},
},
itemTpl :'<div class = mainContent>{text}</div>',
我的问题是“如何在此配置中使用 localstorageProxy。当我直接添加
proxy : {
type : 'localstorage',
id: 'namesListLocalStorage',
url : 'dataFolder/nameList.json',
}
它不显示任何记录。任何指针都会有很大帮助。
谢谢