我正在使用Dojo EnhancedGrid,并希望在调用XSP.partialRefreshPost或XSP.partialRefreshGet后选择一个项目
var store = dataGrid.store;
index = grid.selection.selectedIndex;
var item = dataGrid.getItem(index);
var id = store.getValue(item, "@unid");
var remoteMethod = myRPC.sortGridPosition(index + 'DOWN');
remoteMethod.addCallback(function(response){
// handle whatever came back from the server
XSP.partialRefreshPost("#{id:gridDiv}",{
onComplete: function () {
grid.selection.setSelected(response, true);
grid.selection.setSelected(parseInt(index), false);
}
});
});
但我一直在检查错误找不到focusView of undefined, 如何在XSP.partialRefreshPost之后设置索引?