hor*_*uzz 0 data-binding extjs viewmodel
请参阅以下小提琴:将商店从ViewModel绑定到xtype标签
我无法从我的ViewModel商店获取记录以显示在xtype: 'label'我的表单项中.
这应该很容易,但唉,我的大脑无法工作......
无法为商店的第一条记录创建绑定描述符.您需要为此目的实现一个公式.
在您的视图模型中:
formulas: {
firstTestStoreRecord: {
bind: '{testStore}',
get: function(testStore) {
return testStore.getAt(0);
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后在您的视图中使用它:
bind: {
html: '<b>{firstTestStoreRecord.test}</b>'
}
Run Code Online (Sandbox Code Playgroud)
这是工作小提琴:https://fiddle.sencha.com/#fiddle/25cf&view/editor