我用desktop做了一个桌面,弹出window后,我想通过点击window上的tbar来动态生成了一个GridPanel来显示后台的数据,请问要怎样实现啊?
window的代码:
[code="java"]EripsDesktop.SDMSWindow = Ext.extend(Ext.app.Module, {
id : 'sdms-win',
init : function() {
this.launcher = {
text : '學生訓導系統',
iconCls : 'icon-grid',
handler : this.createWindow,
scope : this
}
},
createWindow : function() {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('sdms-win');
if (!win) {
win = desktop.createWindow({
id : 'sdms-win',
title : '學生訓導系統',
width : 740,
height : 480,
iconCls : 'icon-grid',
shim : false,
animCollapse : false,
constrainHeader : true,
layout : 'fit',
tbar : [{
text : '獎懲事項',
tooltip : '獎懲事項',
iconCls : 'add',
handler : function() {
//这里要怎样写才能为win动态生成一个GridPanel呢 }
}, '-', {
text : '尋到項目',
tooltip : '尋到項目',
iconCls : 'option'
}, '-', {
text : '統計',
tooltip : '統計',
iconCls : 'option'
}]
});
}
win.show();
}
});[/code]