click: function(n) {
treeNodeId = n.attributes.id;
treeNodeInfo = n.attributes.text;
studentInfostore.load({
params: {
start: 0,
limit: 30
},
callback: function(r, options, success) {
if (success == false) {
window.location.href = "Login.jsp";
}
}
});
}
左边的树添加一个单击事件,让后再单击事件中让右边的gridpanel的store,我这里是studentInfostore,去加载信息,这时动态改变studentInfostore的参数就行了。studentInfostore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
method: 'post',
prettyUrls: false,
url: 'getStudentInfo.action'
}),
remoteSort: true,
listeners: {
"beforeload": function(store) {
store.baseParams = {
deptId: treeNodeId,
studentsearchKey: Ext.getCmp("specialkey").getValue()
}
}
}
在store中监听beforeload,让baseParams动态改变 。就行了。
2013年2月25日 14:45