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.

113 lines
3.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. // This is the main layout definition.
  9. //
  10. Ext.onReady(function(){
  11. Ext.QuickTips.init();
  12. // This is an inner body element within the Details panel created to provide a "slide in" effect
  13. // on the panel body without affecting the body's box itself. This element is created on
  14. // initial use and cached in this var for subsequent access.
  15. var detailEl;
  16. // This is the main content center region that will contain each example layout panel.
  17. // It will be implemented as a CardLayout since it will contain multiple panels with
  18. // only one being visible at any given time.
  19. var contentPanel = {
  20. id: 'content-panel',
  21. region: 'center', // this is what makes this panel into a region within the containing layout
  22. layout: 'card',
  23. margins: '2 5 5 0',
  24. activeItem: 0,
  25. border: false,
  26. items: [
  27. // from basic.js:
  28. start, absolute, accordion, anchor, border, cardTabs, cardWizard, column, fit, form, table, vbox, hbox,
  29. // from custom.js:
  30. rowLayout, centerLayout,
  31. // from combination.js:
  32. absoluteForm, tabsNestedLayouts
  33. ]
  34. };
  35. // Go ahead and create the TreePanel now so that we can use it below
  36. var treePanel = new Ext.tree.TreePanel({
  37. id: 'tree-panel',
  38. title: 'Sample Layouts',
  39. region:'north',
  40. split: true,
  41. height: 300,
  42. minSize: 150,
  43. autoScroll: true,
  44. // tree-specific configs:
  45. rootVisible: false,
  46. lines: false,
  47. singleExpand: true,
  48. useArrows: true,
  49. loader: new Ext.tree.TreeLoader({
  50. dataUrl:'tree-data.json'
  51. }),
  52. root: new Ext.tree.AsyncTreeNode()
  53. });
  54. // Assign the changeLayout function to be called on tree node click.
  55. treePanel.on('click', function(n){
  56. var sn = this.selModel.selNode || {}; // selNode is null on initial selection
  57. if(n.leaf && n.id != sn.id){ // ignore clicks on folders and currently selected node
  58. Ext.getCmp('content-panel').layout.setActiveItem(n.id + '-panel');
  59. if(!detailEl){
  60. var bd = Ext.getCmp('details-panel').body;
  61. bd.update('').setStyle('background','#fff');
  62. detailEl = bd.createChild(); //create default empty div
  63. }
  64. detailEl.hide().update(Ext.getDom(n.id+'-details').innerHTML).slideIn('l', {stopFx:true,duration:.2});
  65. }
  66. });
  67. // This is the Details panel that contains the description for each example layout.
  68. var detailsPanel = {
  69. id: 'details-panel',
  70. title: 'Details',
  71. region: 'center',
  72. bodyStyle: 'padding-bottom:15px;background:#eee;',
  73. autoScroll: true,
  74. html: '<p class="details-info">When you select a layout from the tree, additional details will display here.</p>'
  75. };
  76. // Finally, build the main layout once all the pieces are ready. This is also a good
  77. // example of putting together a full-screen BorderLayout within a Viewport.
  78. new Ext.Viewport({
  79. layout: 'border',
  80. title: 'Ext Layout Browser',
  81. items: [{
  82. xtype: 'box',
  83. region: 'north',
  84. applyTo: 'header',
  85. height: 30
  86. },{
  87. layout: 'border',
  88. id: 'layout-browser',
  89. region:'west',
  90. border: false,
  91. split:true,
  92. margins: '2 0 5 5',
  93. width: 275,
  94. minSize: 100,
  95. maxSize: 500,
  96. items: [treePanel, detailsPanel]
  97. },
  98. contentPanel
  99. ],
  100. renderTo: Ext.getBody()
  101. });
  102. });