Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 extjs 3 中,我使用:
if (Model1.getSelectionModel().getSelections().length == 1) { 记录 = Model1.store.getAt(Model1.getStore().indexOf(Model1.getSelectionModel().getSelected())) }
ExtJS4中没有getSelections()方法。您需要使用getSelection().
getSelections()
getSelection()
在以前的版本中,您有:
在 ExtJS4 中,您只有getSelection()which 返回当前选定记录的数组。所以你需要改变你的 if 语句。那应该可以解决您的问题。
额外说明: 使用getStore()方法访问商店而不是使用属性名称store。
getStore()
store