转自: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文本(默认为'')。

71.Ext.form.ComboBox 完整属性的更多相关文章

  1. Ext.form.ComboBox常用属性详解

    Ext.form.ComboBox常用属性详解 标签: Extjs js combo js 代码 var combo = new Ext.form.ComboBox({ store : new Ext ...

  2. Ext.form.ComboBox 后台取值 动态加载 ext5.0.0

    我用的extjs是5.0.0版本的. 请注意:如果这里没有的combobox相关内容,这里一定有. 开始的时候keyup事件取到的数据就是放不到ComboBox中,放全局变量也不好用.最后大神出手帮忙 ...

  3. Ext 向Ext.form.ComboBox()中添加列表的分类

    1.静态 [javascript] view plaincopy var staticComboBox = new Ext.form.ComboBox({   fieldLabel:'回访结果',   ...

  4. EXt form属性

    配置项: success:执行成功后回调的函数,包括两个参数:form和action failure:执行失败后回调的函数,包括两个参数:form和action method:表单的提交方式,有效值包 ...

  5. ExtJs之Ext.form.field.ComboBox组合框

    <!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...

  6. Ext.form.field.Picker (ComboBox、Date、TreePicker、colorpick.Field)竖向滚动导致布局错误

    ComboBox.Date.TreePicker.colorpick.Field这些继承了Ext.form.field.Picker的控件. 在6.0.0和6.0.1中,在界面中存在竖向滚动条时,点击 ...

  7. Ext文本输入框:Ext.form.TextField属性汇总(转) (

    本章介绍Ext.form.TextField组件的基本用法: <form id="form1" runat="server">    <div ...

  8. 8. Ext文本输入框:Ext.form.TextField属性汇总

    转自:https://blog.csdn.net/ryuudenne/article/details/8834650 Ext.form.TextField主要配置表: allowBlank       ...

  9. 86. Ext文本输入框:Ext.form.TextField属性汇总

    转自:https://blog.csdn.net/ryuudenne/article/details/8834650 Ext.form.TextField主要配置表: allowBlank       ...

随机推荐

  1. 牛客多校Round 8

    Solved:2 rank:164 签了两个oeis,但这样真的开心嘛

  2. Bet(The 2016 ACM-ICPC Asia China-Final Contest 思路题)

    题目: The Codejamon game is on fire! Fans across the world are predicting and betting on which team wi ...

  3. subprocess操作命令

    import subprocess 一. run()方法 --->括号里面传参数,主要有cmd, stdout, shell, encoding, check 1.直接传命令 2.命令带参数要以 ...

  4. Vue.Draggable实现拖拽效果(采坑小记)

    之前有写过Vue.Draggable实现拖拽效果(快速使用)(http://www.cnblogs.com/songdongdong/p/6928945.html)最近项目中要用到这个拖拽的效果,当产 ...

  5. c# 缓存!

    做项目的时候获取所有城市的时候,发现每次去获取都花费了很多时间,所以用缓存方法让效率更高! 这是我做的例子,如下: public class CacheGetCity { /// <summar ...

  6. 【Codeforces 923A】Primal Sport

    [链接] 我是链接,点我呀:) [题意] 题意 [题解] 考虑怎么得到数字x2=N,假设是质数p的倍数 那么x1肯定在x2-p+1~x2这个范围内才行 因为p的倍数要刚好大于等于x1, 所以x1肯定是 ...

  7. [luoguP1196] 银河英雄传说(并查集)

    传送门 记录 up[x] 表示 x 上方有多少个 all[x] 表示当前连通的有多少个 find 的时候 和 合并的时候 更新一下即可 ——代码 #include <cstdio> #in ...

  8. Codeforces Round #260 (Div. 2) D

    D. A Lot of Games time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  9. 5-46 新浪微博热门话题 (30分)——unfinished HASH

    5-46 新浪微博热门话题   (30分) 新浪微博可以在发言中嵌入“话题”,即将发言中的话题文字写在一对“#”之间,就可以生成话题链接,点击链接可以看到有多少人在跟自己讨论相同或者相似的话题.新浪微 ...

  10. Ubuntu 16.04安装UltraCopier做为FastCopy的替代方案

    对于Linux的文件复制软件有很多,参考:http://alternativeto.net/software/fastcopy/?platform=linux 对于UltraCopier来说,是比较不 ...