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.

242 lines
7.4 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. /*
  8. * ================ TabPanel with nested layouts =======================
  9. */
  10. // fake grid data used below in the tabsNestedLayouts config
  11. var myData = [
  12. ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
  13. ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
  14. ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
  15. ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
  16. ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
  17. ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
  18. ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
  19. ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
  20. ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
  21. ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],
  22. ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
  23. ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
  24. ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
  25. ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
  26. ['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],
  27. ['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],
  28. ['International Business Machines',81.41,0.44,0.54,'9/1 12:00am'],
  29. ['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],
  30. ['JP Morgan & Chase & Co',45.73,0.07,0.15,'9/1 12:00am'],
  31. ['McDonald\'s Corporation',36.76,0.86,2.40,'9/1 12:00am'],
  32. ['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],
  33. ['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],
  34. ['Pfizer Inc',27.96,0.4,1.45,'9/1 12:00am'],
  35. ['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],
  36. ['The Home Depot, Inc.',34.64,0.35,1.02,'9/1 12:00am'],
  37. ['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],
  38. ['United Technologies Corporation',63.26,0.55,0.88,'9/1 12:00am'],
  39. ['Verizon Communications',35.57,0.39,1.11,'9/1 12:00am'],
  40. ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
  41. ];
  42. var tabsNestedLayouts = {
  43. xtype: 'tabpanel',
  44. id: 'tabs-nested-layouts-panel',
  45. title: 'TabPanel with Nested Layouts',
  46. activeTab: 0,
  47. items:[{
  48. title: 'Foo',
  49. layout: 'border',
  50. items: [{
  51. region: 'north',
  52. title: 'North',
  53. height: 75,
  54. maxSize: 150,
  55. margins: '5 5 0 5',
  56. bodyStyle: 'padding:10px;',
  57. split: true,
  58. html: 'Some content'
  59. },{
  60. xtype: 'tabpanel',
  61. plain: true,
  62. region: 'center',
  63. margins: '0 5 5 5',
  64. activeTab: 0,
  65. items: [{
  66. title: 'Inner Tab 1',
  67. bodyStyle: 'padding:10px;',
  68. html: 'See Inner Tab 2 for another nested BorderLayout.'
  69. },{
  70. title: 'Inner Tab 2',
  71. cls: 'inner-tab-custom', // custom styles in layout-browser.css
  72. layout: 'border',
  73. // Make sure IE can still calculate dimensions after a resize when the tab is not active.
  74. // With display mode, if the tab is rendered but hidden, IE will mess up the layout on show:
  75. hideMode: Ext.isIE ? 'offsets' : 'display',
  76. items: [{
  77. title: 'West',
  78. region: 'west',
  79. collapsible: true,
  80. width: 150,
  81. minSize: 100,
  82. maxSize: 350,
  83. margins: '5 0 5 5',
  84. cmargins: '5 5 5 5',
  85. html: 'Hello',
  86. bodyStyle:'padding:10px;',
  87. split: true
  88. },{
  89. xtype: 'tabpanel',
  90. region: 'center',
  91. margins: '5 5 5 0',
  92. tabPosition: 'bottom',
  93. activeTab: 0,
  94. items: [{
  95. // Panels that are used as tabs do not have title bars since the tab
  96. // itself is the title container. If you want to have a full title
  97. // bar within a tab, you can easily nest another panel within the tab
  98. // with layout:'fit' to acheive that:
  99. title: 'Bottom Tab',
  100. layout: 'fit',
  101. items: {
  102. title: 'Interior Content',
  103. bodyStyle:'padding:10px;',
  104. border: false,
  105. html: 'See the next tab for a nested grid. The grid is not rendered until its tab is first accessed.'
  106. }
  107. },{
  108. // A common mistake when adding grids to a layout is creating a panel first,
  109. // then adding the grid to it. GridPanel (xtype:'grid') is a Panel subclass,
  110. // so you can add it directly as an item into a container. Typically you will
  111. // want to specify layout:'fit' on GridPanels so that they'll size along with
  112. // their container and take up the available space.
  113. title: 'Nested Grid',
  114. xtype: 'grid',
  115. layout: 'fit',
  116. store: new Ext.data.ArrayStore({
  117. fields: [
  118. {name: 'company'},
  119. {name: 'price', type: 'float'},
  120. {name: 'change', type: 'float'},
  121. {name: 'pctChange', type: 'float'},
  122. {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
  123. ]
  124. }),
  125. columns: [
  126. {id:'company',header: 'Company', width: 160, sortable: true, dataIndex: 'company'},
  127. {header: 'Price', width: 75, sortable: true, renderer: 'usMoney', dataIndex: 'price'},
  128. {header: 'Change', width: 75, sortable: true, dataIndex: 'change'},
  129. {header: '% Change', width: 75, sortable: true, dataIndex: 'pctChange'},
  130. {header: 'Last Updated', width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
  131. ],
  132. stripeRows: true,
  133. autoExpandColumn: 'company',
  134. // Add a listener to load the data only after the grid is rendered:
  135. listeners: {
  136. render: function(){
  137. this.store.loadData(myData);
  138. }
  139. }
  140. }]
  141. }]
  142. }]
  143. }]
  144. },{
  145. title: 'Bar',
  146. bodyStyle: 'padding:10px;',
  147. html: 'Nothing to see here.'
  148. }]
  149. };
  150. /*
  151. * ================ Absolute Layout Form =======================
  152. */
  153. var absform = new Ext.form.FormPanel({
  154. baseCls: 'x-plain',
  155. layout:'absolute',
  156. url:'save-form.php',
  157. border: true,
  158. defaultType: 'textfield',
  159. items: [{
  160. x: 0,
  161. y: 5,
  162. xtype: 'label',
  163. text: 'From:'
  164. },{
  165. x: 55,
  166. y: 0,
  167. name: 'from',
  168. anchor:'100%' // anchor width by %
  169. },{
  170. x: 0,
  171. y: 32,
  172. xtype: 'label',
  173. text: 'To:'
  174. },{
  175. // The button is not a Field subclass, so it must be
  176. // wrapped in a panel for proper positioning to work
  177. xtype: 'panel',
  178. x: 55,
  179. y: 27,
  180. items: {
  181. xtype: 'button',
  182. text: 'Contacts...'
  183. }
  184. },{
  185. x: 135,
  186. y: 27,
  187. name: 'to',
  188. anchor: '100%' // anchor width by %
  189. },{
  190. x: 0,
  191. y: 59,
  192. xtype: 'label',
  193. text: 'Subject:'
  194. },{
  195. x: 55,
  196. y: 54,
  197. name: 'subject',
  198. anchor: '100%' // anchor width by %
  199. },{
  200. x:0,
  201. y: 81,
  202. xtype: 'textarea',
  203. name: 'msg',
  204. anchor: '100% 100%' // anchor width and height
  205. }]
  206. });
  207. var absoluteForm = {
  208. title: 'Absolute Layout Form',
  209. id: 'abs-form-panel',
  210. layout: 'fit',
  211. bodyStyle: 'padding:15px;',
  212. items: {
  213. title: 'New Email',
  214. cls: 'email-form',
  215. layout: 'fit',
  216. frame: true,
  217. bodyStyle: 'padding:10px 5px 5px;',
  218. items: absform,
  219. tbar: [{
  220. text: 'Send',
  221. iconCls: 'icon-send'
  222. },'-',{
  223. text: 'Save',
  224. iconCls: 'icon-save'
  225. },{
  226. text: 'Check Spelling',
  227. iconCls: 'icon-spell'
  228. },'-',{
  229. text: 'Print',
  230. iconCls: 'icon-print'
  231. },'->',{
  232. text: 'Attach a File',
  233. iconCls: 'icon-attach'
  234. }]
  235. }
  236. };