2017-08-18 23 views

回答

3

沒有辦法創造一個商店的第一個記錄綁定描述符。您需要爲此執行formula

在您的視圖模型:

formulas: { 
    firstTestStoreRecord: { 
     bind: '{testStore}', 
     get: function(testStore) { 
      return testStore.getAt(0); 
     } 
    } 
} 

然後在您的視圖中使用這樣的:

bind: { 
    html: '<b>{firstTestStoreRecord.test}</b>' 
} 

這裏是工作提琴:https://fiddle.sencha.com/#fiddle/25cf&view/editor

+0

工作就像一個魅力! –

+1

@ scebotari66「沒有辦法爲商店的第一個記錄創建綁定描述符」僅供參考,從6.5開始不再是真實的:https://fiddle.sencha.com/#fiddle/25ck&view/editor –

+0

@EvanTrimboli我不知道。謝謝你的提示! – scebotari66

相關問題