iteye_3598 2010-09-09 17:09
浏览 300
已采纳

extjs portal 实现宽度的自适应

在使用extjs portal 与fusionchar结合做展示时,当调整浏览器窗口时,其中的portal无法自动调整大小,来适应窗口的变化,当刷新下页面时,才能适应窗口大小

部分代码如下:

var c0_r0 = new Ext.ux.Portlet({
xtype:'portlet',
id:'panel1',
margins:'10 0 0 0',
//title: 'Grid in a Portlet',
layout:'fit',
height:300,
collapsible : false,
collapsed:false,
tools: tools,
items: [FCF_Column3DPanel]
});

      var c0_r1 = new Ext.ux.Portlet({
        xtype:'portlet',
        id:'panel2',
        margins:'10 0 0 0',
        //title: 'Grid in a Portlet',
        layout:'fit',
        height:300,
        collapsible : false,
        collapsed:false,
        tools: tools,
        items: [FCF_Pie3DPanel1]
       });

       var c0_r2=new Ext.ux.Portlet({
            xtype:'portlet',
            id:'panel3',
            margins:'10 0 0 0',
            //title: 'Grid in a Portlet',
            layout:'fit',
            height:300,
            collapsible : false,
            collapsed:false,
            tools: tools,
            items: [FCF_LinePanel2]
       });

       var col_0 = new Ext.ux.PortalColumn({
                columnWidth:.5,
                style:'padding:10px 0 10px 10px',
                items:[c0_r0,c0_r1,c0_r2]
       });
       var c1_r0 = new Ext.ux.Portlet({
            xtype:'portlet',
            id:'panel4',
            margins:'10 0 0 0',
            //title: 'Grid in a Portlet',
            layout:'fit',
            height:300,
            collapsible : false,
            collapsed:false,
            tools: tools,
            items: [FCF_FunnelPanel3]
       });
       var c1_r1 = new Ext.ux.Portlet({
            xtype:'portlet',
            id:'panel5',
            margins:'10 0 0 0',
            //title: 'Grid in a Portlet',
            layout:'fit',
            height:300,
            collapsible : false,
            collapsed:false,
            tools: tools,
            items: [FCF_KagiPanel4]
       });
       var c1_r2 = new Ext.ux.Portlet({
            xtype:'portlet',
            id:'panel6',
            margins:'10 0 0 0',
            //title: 'Grid in a Portlet',
            layout:'fit',
            height:300,
            collapsible : false,
            collapsed:false,
            items: [FCF_PyramidPanel5]
     });
       var col_1 = new Ext.ux.PortalColumn({
            columnWidth:.5,
            style:'padding:10px 0 10px 10px',
            items:[c1_r0,c1_r1,c1_r2]
       });
    _portal = new Ext.ux.Portal({
            xtype:'portal',
            border: false,
            //region:'center',
            //margins:'35 5 5 0',
            items:[col_0,col_1]

            /*
             * Uncomment this block to test handling of the drop event. You could use this
             * to save portlet position state for example. The event arg e is the custom 
             * event defined in Ext.ux.Portal.DropZone.
             */
            ,listeners: {
                'drop': function(e){
                    //Ext.Msg.alert('aaa',dump_obj(this.items));
                    //Ext.Msg.alert('aaa',dump_obj(this.items));
                    //Ext.Msg.alert('aaa',dump_obj(e.portal));

                    Ext.Msg.alert('Portlet Dropped', e.panel.title+':id:'+e.panel.id + '<br />Column: ' + 
                      e.columnIndex + '<br />Position: ' + e.position);
                }
            }

    });

    _portalContainer = new Ext.Container({
        //layout:'border',
        renderTo:"biportal",
        height:'100%',
        width:'100%',
        margins:'5 5 5 5',
        frame:false,//
        //border:false,
        //bodyBorder :false, 
        items:[
        _portal
        ]
    });

请问该如何调整脚本代码,使得能适应窗口的变化啊?

  • 写回答

4条回答 默认 最新

  • lizhiyezi 2010-09-11 10:48
    关注

    可能是fusionChar的问题。你可以监听fusionChar所属的panel resize事件动态改变fusionChar的宽高

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题