我有一个奇怪的问题。
在我的代码中,我有以下几行:
var theId = operation.records[0].get('id');
console.log("theId: " + theId); // print 4 in firebug
var index = gridStore.find('id', theId);
console.log("index: " + index); // print 3 in firebug
if (index != -1) {
gridPanel.getSelectionModel().select(index);
}
选择无效!
现在,如果我改变:
var theId = operation.records[0].get('id');
至
var theId = 4;
...选择有效
和 :
console.log("theId: " + theId);
在萤火虫中打印 4
console.log("index: " + index);
在萤火虫中打印 3
为什么 ?theId 的内容始终为 4,index 的内容始终为 3 !!!
任何想法 ?
谢谢,
让-米歇尔