• Extjs随笔


    {
    columnWidth : .1,
    layout : 'form',
    items : [{
    fieldLabel : "至",
    labelSeparator:'',
    labelStyle: 'text-align:center;',
    xtype : "datefield",
    value: new Date(),
    format:'Y-m-d',
    id : 'dateToQuery',
    name : 'dateToQuery',
    hiddenname : 'dateToQuery',
    width : 130
    }]
    }

    {
    xtype:'label',
    html:'',
    style:{
    color:'red'
    },
    id : 'comments',
    name : 'comments',
    hiddenname :'comments',
    480
    }

    1.textField: 
    textField有readOnly属性,但是如果用textField1. readOnly = true是不能实现让textField只读的,方法是用textField1.el.dom.readOnly = true才能实现。 
    2.dateField和combox 
       API里面两者的readOnly 属性是这样描述的: 
          True to mark the field as readOnly in HTML(defaults to false)—      notes:this only sets the element’s readOnly DOM attribute. 
       dateField有readOnly属性,设置dateField1.readOnly = true可以让日期输入框不能书写,但是通过后面的日期选择按钮同样可以改变日期的值,因此达不到我们所要的效果。方法是通过设置disabled属性让整个dateField灰掉,不能选择。Combox的原理也大抵如上。 当dateField日期设置disabled属性为true之后,要想把disabled属性设置设置为false必须用enable()方法。直接把属性设置为false是不起作用的。 
    3.checkBox 
       本例中由于有涉及到树的操作,该树用到了Ext.ux.TreeCheckNodeUI扩展包,就是前面带有checkBox的树结构,因此需要有让树不能进行操作,即把树结构上的checkBox屏蔽的操作。本例中用到的方法是遍历checkBox,设置disable属性为true。如下: 
                ss = Ext.query('*[type=checkbox]'); 
              for (i = 0; i < ss.length; i++) { 
                 ss[i].disabled = '"true"'; 
              } 
       由于是遍历所有的checkBox,因此该方法有一个缺陷就是如果页面中的其他不在树结构里面的checkBox也会一起被设置为disable。

  • 相关阅读:
    Open Live Writer增加代码插件
    WinSCP列出’/’目录项出错
    Ueditor中增加迅雷下载支持
    Ueditor设置默认字体
    PDF编辑、删除、替换某页面或文字
    个人站长如何使用svn发布到服务器不遗漏文件
    PHP 测试程序运行时间 microtime函数用法
    LeetCode---Stack && Heap
    LeetCode---Binary Search
    LeetCode---Hash Table
  • 原文地址:https://www.cnblogs.com/exmyth/p/3229130.html
Copyright © 2020-2023  润新知