ext.net gridlist选择内部元素时自动选择所在行

function changeSelection(id) {
var index = 0;
for (var i = 0; i < mcp_liststore.data.length; i++) {
if (mcp_liststore.data.get(i).id == id) {
index = i;
break;
}
}
for (var i = 0; i < mcp_gridlist.store.getCount(); i++) {
mcp_gridlist.getSelectionModel().deselectRow(i);
}
mcp_gridlist.getSelectionModel().selectRow(index, true);
};

构建html时,给内部元素传入id即可,需要的地方调用
onclick='changeSelection("+p_record.data.ID+")'

posted @ 2018-07-05 14:48  zhaogaojian  阅读(133)  评论(0编辑  收藏  举报