ComboBox最常用的一些属性和方法

来源:互联网 发布:菊花插件dbm数据 编辑:程序博客网 时间:2024/05/29 07:03
  1.     id:'cbid',   
  2.     name:'year',//name只是改下拉的名称   
  3.     hiddenName:'hyear',//提交到后台的input的name   
  4.     width : 80,   
  5.     store : Wayfoon.Year,//填充数据   
  6.     emptyText : '请选择',   
  7.     mode : 'local',//数据模式,local代表本地数据   
  8.     readOnly : true,//是否只读   
  9.     value : (new Date()).YEAR,//默认值,要设置为提交给后台的值,不要设置为显示文本   
  10.     triggerAction : 'all',// 显示所有下列数据,一定要设置属性triggerAction为all   
  11.     allowBlank : false,//不允许为空   
  12.     valueField : 'value',//值   
  13.     displayField : 'text',//显示文本   
  14.     editable: false,//是否允许输入   
  15.     forceSelection: true,//必须选择一个选项   
  16.     blankText:'请选择'//该项如果没有选择,则提示错误信息   

  1. 属性  
  2. view : Ext.DataView  
  3.   
  4. 方法  
  5. ComboBox( Object config )  
  6. 构造  
  7.   
  8. clearValue() : void  
  9. 清除所有文本/值对  
  10.   
  11. collapse() : void  
  12. expand() : void  
  13. 收起/展开下拉列表  
  14.   
  15. doQuery( String query, Boolean forceAll ) : void  
  16. 执行查询  
  17.   
  18. getValue() : String  
  19. 选择当前字段的值  
  20.   
  21. isExpanded() : void  
  22. 下拉列表是展开的?  
  23.   
  24. select( Number index, Boolean scrollIntoView ) : void  
  25. 选中第index列表项  
  26.   
  27. selectByValue( String value, Boolean scrollIntoView ) : Boolean  
  28. 选中值为value的列表项  
  29.   
  30. setEditable( Boolean value ) : void  
  31. 设editable属性为value  
  32.   
  33. setValue( String value ) : void  
  34. 设置当前值为  
  35.   
  36. 配置{  
  37. allQuery : String //''  
  38. autoCreate : Boolean/Object //{tag: "input", type: "text", size: "24", autocomplete: "off"}  
  39. displayField : String //显示字段  
  40. editable : Boolean //true当然就是combobox了,如果不可编辑就是一个select了  
  41. forceSelection : Boolean  
  42. handleHeight : Number //如果resiable为真时,设置  
  43. hiddenName : String  
  44. lazyInit : Boolean //除非得到焦点才开始初始化列表,默认为真  
  45. lazyRender : Boolean //除非请求,才开始输出,默认为假  
  46. listAlign : String //参见Ext.Element.alignTo,默认为'tl-bl',下拉列表的显示方式 bl-tl是在上方显示,相反tl-bl是从下方显示    
  47. listClass : String  
  48. listWidth : Number  
  49. loadingText : String //仅当mode = 'remote'时调用数据时显示的文本  
  50. maxHeight : Number //300  
  51. minChars : Number //最少输入多少个字开始响应,远程时默认为4,本地为0,如果不可编辑则此值无效  
  52. minListWidth : Number  
  53. mode : String //可选值local/remote之一,从本地还是远程取数据  
  54. pageSize : Number //在远程模式下,如果此值大于0会在底部显示一个翻页工具条  
  55. queryDelay : Number //查询延时,远程默认为500,本地10  
  56. queryParam : String //查询参数,默认为query  
  57. resizable : Boolean  
  58. selectOnFocus : Boolean  
  59. selectedClass : String  
  60. shadow : Boolean/String //True或"sides"为默认风格, "frame" for 4-way shadow, and "drop" for bottom-right  
  61. store : Ext.data.Store  
  62. title : String  
  63. transform : Mixed //对应一个select元素,可以将select转为combobox对象  
  64. triggerAction : String //点击按钮时的动作.默认为query  
  65. triggerClass : String  
  66. typeAhead : Boolean //false  
  67. typeAheadDelay : Number //250  
  68. valueField : String  
  69. valueNotFoundText : String //值不存在时的提示信息  
  70. }  
  71.   
  72. 事件  
  73. beforequery : ( Object queryEvent )  
  74. beforeselect : ( Ext.form.ComboBox combo, Ext.data.Record record, Number index )  
  75. collapse : ( Ext.form.ComboBox combo )  
  76. expand : ( Ext.form.ComboBox combo )  
  77. select : ( Ext.form.ComboBox combo, Ext.data.Record record, Number index )  


转自:http://leiwuluan.iteye.com/blog/560554
原创粉丝点击