zoukankan      html  css  js  c++  java
  • ext中fieldLabel文本太宽的问题,以及Panel居中显示

    在layout: ‘column’,后的排列中,右对齐fieldLabel的宽度就不怎么好使。

    经过几次调试,终于可以右对齐fieldLabel了,fieldLabel的右对齐比较麻烦,必须首先在form中设置 labelWidth:40,同时在labelStyle中加上labelStyle : “text-align:right;40;”,这2个地方都要设置宽度才行,否则fieldLabel的宽度就不起作用。

    {
    columnWidth:.33,
    layout:’form’,
    border:false,
    labelWidth: 40,
    items:[{
    xtype:"combo",
    fieldLabel: '地区',
    name: 'combo',
    labelStyle: 'text-align:right;40;',
    store: new Ext.data.SimpleStore({
    fields: ['value', 'text'],
    data: [
    ['value1', 'text1'],
    ['value2', 'text2']
    ]
    }),
    displayField: ‘text’,
    valueField: ‘value’,
    mode: ‘local’,
    emptyText:’请选择’
    }]
    }

    用formPanel做了个登录界面,不能在页面居中,以下是解决方法
    var panel =new Ext.panel({

    });
    var windowWidth = window.screen.availWidth;
    var left=windowWidth/2 – panel的宽度/2;
    var style=’margin-top:150px;margin-left:’+left+’px;’;
    var el=Ext.get(‘div-id’).applyStyles(style);
    panel .render(el);

    可直接用 panel.el.center();//使的PANEL页面居中,注意被渲染之后

  • 相关阅读:
    文件的打开和保存
    eclipse快捷键汇总
    FileNameExtensionFilter文件过滤
    java中文件保存、打开文件对话框
    FileInputStream(字节流)与fileReader(字符流) 的区别
    Java文本编辑器中遇到的问题详解
    前端基础 之 BOM和DOM
    前端基础 之JS
    前端基础 之 CSS
    前端基础之 HTML
  • 原文地址:https://www.cnblogs.com/soundcode/p/2300388.html
Copyright © 2011-2022 走看看