【发布时间】:2019-02-12 10:37:02
【问题描述】:
是否可以使用store 属性创建除Ext.panel.Grid 之外的其他一些元素?
例如。假设我有一个面板:
Ext.create('Ext.panel.Panel', {
layout: 'vbox',
scrollable: true,
items: [
myItemsFunction()
]
}));
我从后端得到这个响应:
{
"rows": [
{
"CreateDateTime": "2015-02-09 14:05:46",
"Name": "de.txt",
"id": "1"
},
{
"CreateDateTime": "2015-02-09 14:05:46",
"Name": "en.txt",
"id": "2"
},
{
"CreateDateTime": "2015-02-09 14:05:46",
"Name": "it.txt",
"id": "3"
}]
}
我在商店中加载的:
var store_documents = Ext.create('Ext.data.Store', {
remoteSort: true,
remoteFilter: true,
proxy: {
type: 'ajax',
api: {
read: baseURL + '&SubFunc=Documents&Action=view',
},
reader: { type: 'json', rootProperty: 'rows', totalProperty: 'total' }
},
autoLoad: true
});
现在,假设我想要这三个文件(de.txt、en.txt、it.txt)的下载按钮。如何根据商店项目动态创建它们?我想把它放在这个myItemsFunction() 中并在面板项中显示它(代码示例的第一个块)?
或者商店只能与Grid绑定?
【问题讨论】:
标签: javascript extjs