Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.onReady(function(){
  8. Ext.QuickTips.init();
  9. // simple array store
  10. var store = new Ext.data.ArrayStore({
  11. fields: ['abbr', 'state', 'nick'],
  12. data : Ext.exampledata.states // from states.js
  13. });
  14. var combo = new Ext.form.ComboBox({
  15. store: store,
  16. displayField:'state',
  17. typeAhead: true,
  18. mode: 'local',
  19. forceSelection: true,
  20. triggerAction: 'all',
  21. emptyText:'Select a state...',
  22. selectOnFocus:true,
  23. applyTo: 'local-states'
  24. });
  25. //Simple arrays can be used directly as the store config. 1-dimensional arrays
  26. //will automatically be expanded (each array item will be the combo value and text)
  27. //and for multi-dimensional arrays, the value in index 0 of each item will be assumed
  28. //to be the value, while the value at index 1 is assumed to be the text. For example,
  29. //[['AL', 'Alabama'],['AK', 'Alaska'], etc.]. Any other values beyond index 1 within
  30. //each item will be ignored using this approach.
  31. var comboFromArray = new Ext.form.ComboBox({
  32. store: Ext.exampledata.states,
  33. typeAhead: true,
  34. forceSelection: true,
  35. triggerAction: 'all',
  36. emptyText:'Select a state...',
  37. selectOnFocus:true,
  38. applyTo: 'array-states'
  39. });
  40. var comboWithTooltip = new Ext.form.ComboBox({
  41. tpl: '<tpl for="."><div ext:qtip="{state}. {nick}" class="x-combo-list-item">{state}</div></tpl>',
  42. store: store,
  43. displayField:'state',
  44. typeAhead: true,
  45. forceSelection: true,
  46. mode: 'local',
  47. triggerAction: 'all',
  48. emptyText:'Select a state...',
  49. selectOnFocus:true,
  50. applyTo: 'local-states-with-qtip'
  51. });
  52. var converted = new Ext.form.ComboBox({
  53. typeAhead: true,
  54. triggerAction: 'all',
  55. transform:'state',
  56. width:135,
  57. forceSelection:true
  58. });
  59. // Create code view Panels. Ignore.
  60. new Ext.Panel({
  61. contentEl: 'state-combo-code',
  62. width: Ext.getBody().child('p').getWidth(),
  63. title: 'View code to create this combo',
  64. hideCollapseTool: true,
  65. titleCollapse: true,
  66. collapsible: true,
  67. collapsed: true,
  68. renderTo: 'state-combo-code-panel'
  69. });
  70. new Ext.Panel({
  71. contentEl: 'state-combo-qtip-code',
  72. autoScroll: true,
  73. width: Ext.getBody().child('p').getWidth(),
  74. title: 'View code to create this combo',
  75. hideCollapseTool: true,
  76. titleCollapse: true,
  77. collapsible: true,
  78. collapsed: true,
  79. renderTo: 'state-combo-qtip-code-panel'
  80. });
  81. new Ext.Panel({
  82. contentEl: 'array-combo-code',
  83. autoScroll: true,
  84. width: Ext.getBody().child('p').getWidth(),
  85. title: 'View code to create this combo',
  86. hideCollapseTool: true,
  87. titleCollapse: true,
  88. collapsible: true,
  89. collapsed: true,
  90. renderTo: 'array-combo-code-panel'
  91. });
  92. new Ext.Panel({
  93. contentEl: 'transformed-combo-code',
  94. autoScroll: true,
  95. width: Ext.getBody().child('p').getWidth(),
  96. title: 'View code to create this combo',
  97. hideCollapseTool: true,
  98. titleCollapse: true,
  99. collapsible: true,
  100. collapsed: true,
  101. renderTo: 'transformed-combo-code-panel'
  102. });
  103. });