• 71.Ext.form.ComboBox 完整属性


    转自:https://blog.csdn.net/taotaoqi/article/details/7409514

    Ext.form.ComboBox

    类全称: Ext.form.ComboBox

    继承自于: Ext.form.TriggerField

     

    一个提供自动完成、远程加载、分页和许多其他特性的组合框。

     

    配置项

    1、transform : Mixed 

    要转换为组合框的id,DOM节点或者已有的select元素。

     

    2、lazyRender : Boolean 

    值为true时阻止ComboBox渲染直到该对象被请求(被渲染到Ext.Editor 组件的时候应该使用这个参数,默认为 false)。 

     

    3、autoCreate : String/Object 

    一个指定的DomHelper配置对象,如果为真则为一个默认对象({tag: "input", type: "text", size: "20", autocomplete: "off"})。

     

    4、store : Ext.data.Store/Array 

    该组合框绑定的数据仓库(默认为 undefined)。

    如是的string值,不要用""引起来,否则就不是object数据,而是字符串,这是一个很巧妙的关键点:把服务器的字符串转化为js的object数据,是不是超级方便

    //下面就几种数据以代码举例说明
    1.一维数组:["江西","湖北"],值同时赋给ComboBox的value和text
    2.二维和多维数组:[["one","bbar","111"],["two","tbar","222"]],第一维和第二维分别赋值给value和text,其他维忽略
    3.store类型:包括GroupingStore, JsonStore, SimpleStore.
        //我们分三步走:
         //第一步:提供数据:
             var data=[['湖北','hubei'],['江西','jiangxi'],['安徽','anhui']];
        //第二步:导入到store中:
             var store = new Ext.data.SimpleStore({
                 fields: ['chinese', 'english'],
                 data : data
            });
         //第三步 :把store托付给comboBox的store
        var combo = new Ext.form.ComboBox({
            store: store,
            displayField:'english',//store字段中你要显示的字段,多字段必选参数,默认当mode为remote时displayField为undefine,当select列表时displayField为"text"
            mode: 'local',//因为data已经取数据到本地了,所以'local',默认为"remote",枚举完
            emptyText:'请选择一个省份...',
            applyTo: 'combo'
        });

    5、title : String 

    如果提供了,则会创建一个包含此文本的元素并被添加到下拉列表的顶部(默认为 undefined,表示没有头部元素)。

     

    6、listWidth : Number 

    以象素表示的下拉列表的宽度(默认的宽度与ComboBox的width属性一致)。 

     

    7、displayField : String 

    组合框用以展示的数据的字段名(如果mode='remote'则默认为 undefined,如果mode = 'local' 则默认为 'text')。 T

     

    8、valueField : String 

    组合框用以取值的数据的字段名(如果mode='remote'则默认为 undefined,如果mode = 'local' 则默认为 'value')。

     

    9、hiddenName : String 

    如果指定了, 则会动态生成一个以指定名称命名的隐藏域用来存放值数据(默认为)。

    //真正提交时此combo的name,请一定要注意

     

    10、hiddenId : String 

    If #hiddenName is specified, hiddenId can also be provided to give the hidden field a unique id (defaults to the hiddenName). The hiddenId and combo #id should be different, since no two DOM nodes should share the same id.  

     

    11、hiddenValue : String 

    Sets the initial value of the hidden field if #hiddenName is specified to contain the selected #valueField, from the Store. Defaults to the configured #value.  

     

     

    12、listClass : String 

     

    13、selectedClass : String 

    下拉列表中选中项应用的CSS类(默认为 'x-combo-selected')。

     

    14、triggerClass : String 

    应用到触发器身上的CSS样式类。

     

    15、shadow : Boolean/String 

    值为true或者"sides"为默认效果,"frame"为四方向阴影,"drop" 为右下角方向阴影。 

     

    16、listAlign : String 

    一个有效的方位锚点值。点击Ext.Element#alignTo查看支持的方向锚点(默认为 'tl-bl')。

     

    17、maxHeight : Number 

    以象素表示的下拉列表最大高度(默认为 300)

     

    18、minHeight : Number 

    以象素表示的下拉列表最小高度(默认为 90)

     

    19、triggerAction : String 

    请设置为"all",否则默认为"query"的情况下,你选择某个值后,再此下拉时,只出现匹配选项,如果设为"all"的话,每次下拉均显示全部选项

     

    20、minChars : Number 

    在autocomplete和typeahead 被激活之前用户必须输入的字符数(默认为4,如果editable = false则此属性无效)。

     

    21、typeAhead : Boolean 

    值为true时在经过指定延迟(typeAheadDelay)后弹出并自动选择输入的文本,如果该文本与已知的值相匹配(默认为false)。

     

    22、queryDelay : Number 

    以毫秒表示的从开始输入到发出查询语句过滤下拉列表的时长(如果mode='remote'则默认为500,如果mode = 'local' 则默认为10)。

     

    23、pageSize : Number 

    如果值大于0,则在下拉列表的底部显示一个分页工具条,并且在执行过滤查询时将传递起始页和限制参数。 只在 mode = 'remote'时生效(默认为 0)。

     

    24、selectOnFocus : Boolean 

    值为 ture 时表示字段获取焦点时自动选择字段既有文本(默认为 false)。 

     

    25、queryParam : String 

    供querystring查询时传递的名字(默认为 'query')。

     

    26、loadingText : String 

    当读取数据时在下拉列表显示的文本。仅当mode = 'remote'时可用(默认为 'Loading...')。 

     

    27、resizable : Boolean 

    值为true时则在下拉列表的底部添加缩放柄(默认为false)。

     

    28、handleHeight : Number 

    以像素表示的下拉列表的缩放柄的高度,仅当resizable = true 时可用(默认为 8)。

     

    29、editable : Boolean 

    值为false时防止用户直接在输入框内输入文本,就像传统的选择框一样(默认为 true)。

     

    30、allQuery : String 

    发送到服务器用以返回不经过滤的所有记录的文本(默认为 '')。

     

    31、mode : String 

    如果ComboBox读取本地数据则将值设为'local'(默认为 'remote' 表示从服务器读取数据)。 

     

    32、minListWidth : Number 

    以像素表示的下拉列表的最小宽度(默认为70, 如果listWidth的指定值更高则自动忽略该参数)。

     

    33、forceSelection : Boolean 

    值为true时将限定选中的值为列表中的值,值为false则允许用户将任意文本设置到字段(默认为 false)。

     

    34、typeAheadDelay : Number 

    以毫秒表示的 typeahead 文本延迟显示量,仅当 typeAhead = true 时生效(默认为 250)。

     

    35、valueNotFoundText : String 

    当使用 name/value 组合框时,如果调用setValue方法时传递的值没有在仓库中找到,且定义了valueNotFoundText则在字段中显示该值(默认为 undefined)。

     

    36、lazyInit : Boolean 

    True to not initialize the list for this combo until the field is focused (defaults to true)  

     

    37、ext:qtip

    attribute which might display other fields from the Store. 

    The dropdown list is displayed in a DataView. See Ext.DataView for details. 

     

    38、itemSelector : String 

    This setting is required if a custom XTemplate has been specified in #tpl which assigns a class other than 'x-combo-list-item' to dropdown list items. A 

     

    simple CSS selector (e.g. div.some-class or span:first-child) that will be used to determine what nodes the DataView which handles the dropdown display will 

     

    be working with.  

     

    39、hideTrigger : Boolean 

    为true时隐藏触发元素,只显示基本文本域(默认为false)。

     

    40、vtypeText : String 

    在当前字段的#vtype中,制定一个错误信息代替默认的(默认为null)。如vtype不设置该项就无效。 

     

    41、stripCharsRe : RegExp 

    一个JavaScript正则表达式,用于在进行验证该动作之前抽离不需要的内容(默认为null)。

     

    42、grow : Boolean 

    当值为 true 时表示字段可以根据内容自动伸缩。

     

    43、growMin : Number 

    当 grow = true 时允许的字段最小宽度(默认为 30) 

     

    44、growMax : Number 

    当 grow = true 时允许的字段最大宽度(默认为 800)

     

    45、vtype : String 

    中定义的效验类型名(默认为 null)

     

    46、maskRe : RegExp 

    一个用来过滤无效按键的正则表达式(默认为 null) 

     

    47、disableKeyFilter : Boolean 

    值为 true 时禁用输入按键过滤(默认为 false) 

     

    48、allowBlank : Boolean 

    值为 false 时将效验输入字符个数大于0(默认为 true)

     

    49、minLength : Number 

    输入字段所需的最小字符数(默认为 0) 

     

    50、maxLength : Number 

    输入字段允许的最大字符数(默认为 Number.MAX_VALUE) 

     

    51、minLengthText : String 

    输入字符数小于最小字符数时显示的文本(默认为"The minimum length for this field is {minLength}") 

     

    52、maxLengthText : String 

    输入字符数小于最小字符数时显示的文本(默认为"The maximum length for this field is {maxLength}") 

     

    53、blankText : String 

    当允许为空效验失败时显示的错误文本(默认为 "This field is required")。 

     

    54、validator : Function 

    字段效验时调用的自定义的效验函数(默认为 null)。 如果启用此项,则此函数将在所有基础效验(#allowBlank、#minLength、#maxLength和任意的#vtype)成功之后被调用,调用函数时传递的参数为该字段的值。且此函数的有效返回应为成功时返回 true,失败时返回错误文本。

     

    55、regex : RegExp 

    一个用以在效验时使用的 JavaScript 正则表达式对象(默认为 null)。如果启用此项,则此正则表达式将在所有基础效验成功之后被执行,执行此正则表达式时传递的参数为该字段的值。如果效验失败,则根据#regexText的设置将字段标记为无效。

     

    56、regexText : String 

    当#regex被设置且效验失败时显示的错误文本(默认为 "")。

     

    57、emptyText : String 

    空字段中显示的文本(默认为 null)。注意,只要这个字段是被激活的而且name属性是有被指定的,那么也会发送到服务端。 

     

    58、emptyClass : String 

    #emptyText使用的CSS样式类名(默认为 'x-form-empty-field')。此类的添加与移除均由当前字段是否有值来自动处理。 

     

    59、enableKeyEvents : Boolean 

    True表示,为HTML的input输入字段激活键盘事件的代理(默认为false)

     

    60、fieldLabel : String 

    在组件旁边那里显示的label文本(默认为'')。

  • 相关阅读:
    ADC和RTC的寄存器的读取
    串口中断
    chengdongyue的笔记
    UART速度的问题
    tags
    strtok
    exports、module.exports和export、export default到底是咋回事
    module.exports与exports,export与export default之间的关系和区别
    Vue2.x中的Render函数
    Vue的入门之安装
  • 原文地址:https://www.cnblogs.com/sharpest/p/7657555.html
Copyright © 2020-2023  润新知