feifeishuashua 2010-10-19 16:12
浏览 231
已采纳

GridPanel中要用到两个view,改怎么办?

var grid_daily_hq = new Ext.grid.GridPanel({

autoScroll : true,
autoShow : true,
border : false,
store : store_daily_hq,
stripeRows : true,
cm : cm,
sm : new Ext.grid.RowSelectionModel({
singleSelect : true
}),
pageSize : pagesizes,
autoExpandColumn : 'name',
frame : true,
tbar : ['合同查询: ', ' ', new Ext.app.SearchField({
pageSize : pagesizes,
store : store_daily_hq,
paramName : '_Price[like][double]', // 需要查询的字段和方式
width : 250
})],
bbar : pagingBar_daily_hq,
view : new Ext.grid.GridView({ [color=red]-----第一个view[/color]
forceFit : true,
getColumnStyle : function(col, isHeader) {
var style = !isHeader? (this.cm.config[col].css || ''): '';
style += 'width:' + this.getColumnWidth(col)+ ';';
if (this.cm.isHidden(col)) {
style += 'display:none;';
}
if (isHeader) {
var align = 'center';
if (align) {
style += 'text-align:' + align + ';';
}
} else {
var align = this.cm.config[col].textalign;
if (align) {
style += 'text-align:' + align + ';';
}
}
return style;
}
}),
view : new Ext.grid.GroupingView({ [color=red]-----第二个view[/color]
forceFit : true,
groupTextTpl : '{text} ({[values.rs.length]} {["条"]})'
}),
iconCls : 'icon-grid'
});

  • 写回答

4条回答 默认 最新

  • lizhiyezi 2010-10-19 17:33
    关注

    销毁有问题,使用下面代码吧

    (function() {
    if (this.colMenu) {
    Ext.menu.MenuMgr
    .unregister(this.colMenu);
    this.colMenu.destroy();
    delete this.colMenu;
    }
    if (this.hmenu) {
    Ext.menu.MenuMgr.unregister(this.hmenu);
    this.hmenu.destroy();
    delete this.hmenu;
    }

                                    if (this.dragZone) {
                                        this.dragZone.unreg();
                                    }
    
                                    Ext.fly(this.innerHd).removeAllListeners();
                                    Ext.removeNode(this.innerHd);
    
                                    Ext.destroy(this.resizeMarker,
                                            this.resizeProxy, this.focusEl,
                                            this.mainBody, this.scroller,
                                            this.mainHd, this.mainWrap,
                                            this.dragZone, this.splitZone,
                                            this.columnDrag, this.columnDrop);
    
                                    this.initData(null, null);
    
                                    Ext.EventManager.removeResizeListener(
                                            this.onWindowResize, this);
                                    this.purgeListeners();
                                }).call(grid.view)
                                grid.view.purgeListeners();
                                grid.purgeListeners();
                                grid.view = grid.view2;
                                grid.view.init(grid);
                                grid.view.render();
                                grid.view.refresh(true);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料