【发布时间】:2019-01-29 23:58:45
【问题描述】:
我有存储从服务器返回的数据:
Ext.define('Admin.store.dashboard.NPS', {
extend: 'Ext.data.Store',
alias: 'store.nps',
autoLoad : false,
proxy : {
type: 'api',
url : SITE_URL + '/api/surveys/nps'
},
fields : [
{
type: 'float',
name: 'nps'
}
]
});
我想在 Ext.Component 的 tpl 中显示该数据:
Ext.define('Admin.view.dashboard.NPSPercent', {
extend: 'Ext.Component',
xtype: 'nps-percent',
bind: {
data: {
nps_percent: '{nps}'
}
},
tpl: new Ext.XTemplate('<div class="percent">+{nps_percent.nps}</div>')
});
我尝试将数据绑定到加载的商店,但它不起作用。
【问题讨论】:
标签: extjs extjs6-classic extjs6-modern