日期:2014-05-16  浏览次数:20482 次

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并显示一些数据,如何实现啊?

------解决方案--------------------
给我分吧,哈哈,我来围观