4
在ExtJS的3我用: 如何從商店中選擇網格中的行記錄?
if (Model1.getSelectionModel().getSelections().length == 1) { record = Model1.store.getAt(Model1.getStore().indexOf(Model1.getSelectionModel().getSelected())) },但在extjs4它不是工作...
在ExtJS的3我用: 如何從商店中選擇網格中的行記錄?
if (Model1.getSelectionModel().getSelections().length == 1) { record = Model1.store.getAt(Model1.getStore().indexOf(Model1.getSelectionModel().getSelected())) },但在extjs4它不是工作...
有一個在ExtJS4沒有getSelections()
方法。您需要使用getSelection()
。
在以前的版本中,您有:
在ExtJS4中,您只有getSelection()
,它返回當前選定記錄的數組。所以你需要改變你的if語句。這應該能解決你的問題。
額外注: 使用getStore()
方法來訪問存儲,而不是使用屬性名store
。
哪部分不起作用? if語句或getAt? – 2011-05-03 21:03:00