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.

124 lines
3.6 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. Ext.form.Field.prototype.msgTarget = 'side';
  10. /*
  11. * Ext.ux.form.MultiSelect Example Code
  12. */
  13. var msForm = new Ext.form.FormPanel({
  14. title: 'MultiSelect Test',
  15. width: 700,
  16. bodyStyle: 'padding:10px;',
  17. renderTo: 'multiselect',
  18. items:[{
  19. xtype: 'multiselect',
  20. fieldLabel: 'Multiselect<br />(Required)',
  21. name: 'multiselect',
  22. width: 250,
  23. height: 200,
  24. allowBlank:false,
  25. store: [[123,'One Hundred Twenty Three'],
  26. ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
  27. ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
  28. tbar:[{
  29. text: 'clear',
  30. handler: function(){
  31. msForm.getForm().findField('multiselect').reset();
  32. }
  33. }],
  34. ddReorder: true
  35. }],
  36. tbar:[{
  37. text: 'Options',
  38. menu: [{
  39. text: 'Set Value (2,3)',
  40. handler: function(){
  41. msForm.getForm().findField('multiselect').setValue('2,3');
  42. }
  43. },{
  44. text: 'Toggle Enabled',
  45. handler: function(){
  46. var m = msForm.getForm().findField('multiselect');
  47. if (!m.disabled) {
  48. m.disable();
  49. } else {
  50. m.enable();
  51. }
  52. }
  53. }]
  54. }],
  55. buttons: [{
  56. text: 'Save',
  57. handler: function(){
  58. if(msForm.getForm().isValid()){
  59. Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
  60. msForm.getForm().getValues(true));
  61. }
  62. }
  63. }]
  64. });
  65. var ds = new Ext.data.ArrayStore({
  66. data: [[123,'One Hundred Twenty Three'],
  67. ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
  68. ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
  69. fields: ['value','text'],
  70. sortInfo: {
  71. field: 'value',
  72. direction: 'ASC'
  73. }
  74. });
  75. /*
  76. * Ext.ux.form.ItemSelector Example Code
  77. */
  78. var isForm = new Ext.form.FormPanel({
  79. title: 'ItemSelector Test',
  80. width:700,
  81. bodyStyle: 'padding:10px;',
  82. renderTo: 'itemselector',
  83. items:[{
  84. xtype: 'itemselector',
  85. name: 'itemselector',
  86. fieldLabel: 'ItemSelector',
  87. imagePath: '../ux/images/',
  88. multiselects: [{
  89. width: 250,
  90. height: 200,
  91. store: ds,
  92. displayField: 'text',
  93. valueField: 'value'
  94. },{
  95. width: 250,
  96. height: 200,
  97. store: [['10','Ten']],
  98. tbar:[{
  99. text: 'clear',
  100. handler:function(){
  101. isForm.getForm().findField('itemselector').reset();
  102. }
  103. }]
  104. }]
  105. }],
  106. buttons: [{
  107. text: 'Save',
  108. handler: function(){
  109. if(isForm.getForm().isValid()){
  110. Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
  111. isForm.getForm().getValues(true));
  112. }
  113. }
  114. }]
  115. });
  116. });