ExtJs window如何动态添加GridPanel
我用desktop做了一个桌面,代码:
- JScript code
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() { //gpanel.applyTo(win); store.load(); } }, '-', { text : '到目', tooltip : 'ddd', iconCls : 'option' }, '-', { text : '', tooltip : '', iconCls : 'option' }] }); } win.show(); } });
然后我想当我点击tbar的按钮时,动态的生成一个GridPanel并显示一些数据,如何实现啊?
[解决办法]
给我分吧,哈哈,我来围观