0
請看下面的小提琴:Bind store from a ViewModel to an xtype labelExtJS的:我如何標籤應用到視圖模型商店綁定一個記錄
我無法從我的ViewModel的商店獲得紀錄的xtype: 'label'
項目,以顯示我的形成。
這應該是容易的,但很可惜我的大腦不能正常工作......
請看下面的小提琴:Bind store from a ViewModel to an xtype labelExtJS的:我如何標籤應用到視圖模型商店綁定一個記錄
我無法從我的ViewModel的商店獲得紀錄的xtype: 'label'
項目,以顯示我的形成。
這應該是容易的,但很可惜我的大腦不能正常工作......
沒有辦法創造一個商店的第一個記錄綁定描述符。您需要爲此執行formula。
在您的視圖模型:
formulas: {
firstTestStoreRecord: {
bind: '{testStore}',
get: function(testStore) {
return testStore.getAt(0);
}
}
}
然後在您的視圖中使用這樣的:
bind: {
html: '<b>{firstTestStoreRecord.test}</b>'
}
工作就像一個魅力! –
@ scebotari66「沒有辦法爲商店的第一個記錄創建綁定描述符」僅供參考,從6.5開始不再是真實的:https://fiddle.sencha.com/#fiddle/25ck&view/editor –
@EvanTrimboli我不知道。謝謝你的提示! – scebotari66