form-configs.js
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:9k
源码类别:

JavaScript

开发平台:

JavaScript

  1. /*!
  2.  * Ext JS Library 3.1.0
  3.  * Copyright(c) 2006-2009 Ext JS, LLC
  4.  * licensing@extjs.com
  5.  * http://www.extjs.com/license
  6.  */
  7. /*!
  8.  * Ext JS Library 3.1.0
  9.  * Copyright(c) 2006-2009 Ext JS, LLC
  10.  * licensing@extjs.com
  11.  * http://www.extjs.com/license
  12.  */
  13. /*!
  14.  * Ext JS Library 3.1.0
  15.  * Copyright(c) 2006-2009 Ext JS, LLC
  16.  * licensing@extjs.com
  17.  * http://www.extjs.com/license
  18.  */
  19. /*!
  20.  * Ext JS Library 3.1.0
  21.  * Copyright(c) 2006-2009 Ext JS, LLC
  22.  * licensing@extjs.com
  23.  * http://www.extjs.com/license
  24.  */
  25. /*!
  26.  * Ext JS Library 3.1.0
  27.  * Copyright(c) 2006-2009 Ext JS, LLC
  28.  * licensing@extjs.com
  29.  * http://www.extjs.com/license
  30.  */
  31. /*!
  32.  * Ext JS Library 3.1.0
  33.  * Copyright(c) 2006-2009 Ext JS, LLC
  34.  * licensing@extjs.com
  35.  * http://www.extjs.com/license
  36.  */
  37. /*!
  38.  * Ext JS Library 3.1.0
  39.  * Copyright(c) 2006-2009 Ext JS, LLC
  40.  * licensing@extjs.com
  41.  * http://www.extjs.com/license
  42.  */
  43. /*!
  44.  * Ext JS Library 3.1.0
  45.  * Copyright(c) 2006-2009 Ext JS, LLC
  46.  * licensing@extjs.com
  47.  * http://www.extjs.com/license
  48.  */
  49. /*!
  50.  * Ext JS Library 3.1.0
  51.  * Copyright(c) 2006-2009 Ext JS, LLC
  52.  * licensing@extjs.com
  53.  * http://www.extjs.com/license
  54.  */
  55. /*!
  56.  * Ext JS Library 3.1.0
  57.  * Copyright(c) 2006-2009 Ext JS, LLC
  58.  * licensing@extjs.com
  59.  * http://www.extjs.com/license
  60.  */
  61. /*!
  62.  * Ext JS Library 3.1.0
  63.  * Copyright(c) 2006-2009 Ext JS, LLC
  64.  * licensing@extjs.com
  65.  * http://www.extjs.com/license
  66.  */
  67. /*!
  68.  * Ext JS Library 3.1.0
  69.  * Copyright(c) 2006-2009 Ext JS, LLC
  70.  * licensing@extjs.com
  71.  * http://www.extjs.com/license
  72.  */
  73. /*!
  74.  * Ext JS Library 3.1.0
  75.  * Copyright(c) 2006-2009 Ext JS, LLC
  76.  * licensing@extjs.com
  77.  * http://www.extjs.com/license
  78.  */
  79. /*!
  80.  * Ext JS Library 3.1.0
  81.  * Copyright(c) 2006-2009 Ext JS, LLC
  82.  * licensing@extjs.com
  83.  * http://www.extjs.com/license
  84.  */
  85. /*!
  86.  * Ext JS Library 3.1.0
  87.  * Copyright(c) 2006-2009 Ext JS, LLC
  88.  * licensing@extjs.com
  89.  * http://www.extjs.com/license
  90.  */
  91. /*!
  92.  * Ext JS Library 3.1.0
  93.  * Copyright(c) 2006-2009 Ext JS, LLC
  94.  * licensing@extjs.com
  95.  * http://www.extjs.com/license
  96.  */
  97. /*!
  98.  * Ext JS Library 3.1.0
  99.  * Copyright(c) 2006-2009 Ext JS, LLC
  100.  * licensing@extjs.com
  101.  * http://www.extjs.com/license
  102.  */
  103. /*!
  104.  * Ext JS Library 3.1.0
  105.  * Copyright(c) 2006-2009 Ext JS, LLC
  106.  * licensing@extjs.com
  107.  * http://www.extjs.com/license
  108.  */
  109. /*!
  110.  * Ext JS Library 3.1.0
  111.  * Copyright(c) 2006-2009 Ext JS, LLC
  112.  * licensing@extjs.com
  113.  * http://www.extjs.com/license
  114.  */
  115. /*!
  116.  * Ext JS Library 3.1.0
  117.  * Copyright(c) 2006-2009 Ext JS, LLC
  118.  * licensing@extjs.com
  119.  * http://www.extjs.com/license
  120.  */
  121. /*!
  122.  * Ext JS Library 3.1.0
  123.  * Copyright(c) 2006-2009 Ext JS, LLC
  124.  * licensing@extjs.com
  125.  * http://www.extjs.com/license
  126.  */
  127. /*!
  128.  * Ext JS Library 3.1.0
  129.  * Copyright(c) 2006-2009 Ext JS, LLC
  130.  * licensing@extjs.com
  131.  * http://www.extjs.com/license
  132.  */
  133. /*!
  134.  * Ext JS Library 3.1.0
  135.  * Copyright(c) 2006-2009 Ext JS, LLC
  136.  * licensing@extjs.com
  137.  * http://www.extjs.com/license
  138.  */
  139. /*!
  140.  * Ext JS Library 3.1.0
  141.  * Copyright(c) 2006-2009 Ext JS, LLC
  142.  * licensing@extjs.com
  143.  * http://www.extjs.com/license
  144.  */
  145. /*!
  146.  * Ext JS Library 3.1.0
  147.  * Copyright(c) 2006-2009 Ext JS, LLC
  148.  * licensing@extjs.com
  149.  * http://www.extjs.com/license
  150.  */
  151. /*!
  152.  * Ext JS Library 3.1.0
  153.  * Copyright(c) 2006-2009 Ext JS, LLC
  154.  * licensing@extjs.com
  155.  * http://www.extjs.com/license
  156.  */
  157. /*!
  158.  * Ext JS Library 3.1.0
  159.  * Copyright(c) 2006-2009 Ext JS, LLC
  160.  * licensing@extjs.com
  161.  * http://www.extjs.com/license
  162.  */
  163. /*!
  164.  * Ext JS Library 3.1.0
  165.  * Copyright(c) 2006-2009 Ext JS, LLC
  166.  * licensing@extjs.com
  167.  * http://www.extjs.com/license
  168.  */
  169. /*!
  170.  * Ext JS Library 3.1.0
  171.  * Copyright(c) 2006-2009 Ext JS, LLC
  172.  * licensing@extjs.com
  173.  * http://www.extjs.com/license
  174.  */
  175. /*!
  176.  * Ext JS Library 3.1.0
  177.  * Copyright(c) 2006-2009 Ext JS, LLC
  178.  * licensing@extjs.com
  179.  * http://www.extjs.com/license
  180.  */
  181. /*!
  182.  * Ext JS Library 3.1.0
  183.  * Copyright(c) 2006-2009 Ext JS, LLC
  184.  * licensing@extjs.com
  185.  * http://www.extjs.com/license
  186.  */
  187. /*!
  188.  * Ext JS Library 3.1.0
  189.  * Copyright(c) 2006-2009 Ext JS, LLC
  190.  * licensing@extjs.com
  191.  * http://www.extjs.com/license
  192.  */
  193. /*!
  194.  * Ext JS Library 3.1.0
  195.  * Copyright(c) 2006-2009 Ext JS, LLC
  196.  * licensing@extjs.com
  197.  * http://www.extjs.com/license
  198.  */
  199. /*!
  200.  * Ext JS Library 3.1.0
  201.  * Copyright(c) 2006-2009 Ext JS, LLC
  202.  * licensing@extjs.com
  203.  * http://www.extjs.com/license
  204.  */
  205. /*!
  206.  * Ext JS Library 3.1.0
  207.  * Copyright(c) 2006-2009 Ext JS, LLC
  208.  * licensing@extjs.com
  209.  * http://www.extjs.com/license
  210.  */
  211. /*!
  212.  * Ext JS Library 3.1.0
  213.  * Copyright(c) 2006-2009 Ext JS, LLC
  214.  * licensing@extjs.com
  215.  * http://www.extjs.com/license
  216.  */
  217. /*!
  218.  * Ext JS Library 3.1.0
  219.  * Copyright(c) 2006-2009 Ext JS, LLC
  220.  * licensing@extjs.com
  221.  * http://www.extjs.com/license
  222.  */
  223. /*!
  224.  * Ext JS Library 3.1.0
  225.  * Copyright(c) 2006-2009 Ext JS, LLC
  226.  * licensing@extjs.com
  227.  * http://www.extjs.com/license
  228.  */
  229. //var doLayout = Ext.Container.prototype.doLayout;
  230. // Ext.override(Ext.Container, {
  231. //     doLayout: function() {
  232. //         doLayout.apply(this, arguments);
  233. //         console.log(this.id, this.ownerCt && this.ownerCt.id, this.ownerCt && this.ownerCt.items.getCount());
  234. //     }
  235. // })
  236. // For forms, use xtype: 'panel', layout: 'form'.
  237. // IE 6 is not always able to free the form tag element
  238. // if using xtype: 'form'.
  239. // There are 2 form configs -- will use (mod 2) to pick one.
  240. var formConfigs = [{
  241.    //
  242.    // -- form config 1
  243.    //
  244.    xtype: 'form',
  245.    labelWidth: 75,
  246.    url: 'save-form.php',
  247.    frame: true,
  248.    baseCls: 'x-bubble',
  249.    width: 680,
  250.    autoHeight: true,
  251.    bodyStyle: { 'padding': '5px 7px 0px 7px' },
  252.    items: [{
  253.       xtype: 'fieldset',
  254.       collapsible: true,
  255.       title: 'User Information',
  256.       autoHeight: true,
  257.       autoWidth: true,
  258.       defaultType: 'textfield',
  259.       collapsed: true,
  260.       items :[{
  261.          fieldLabel: 'First Name',
  262.          name: 'first',
  263.          allowBlank: false
  264.       },{
  265.          fieldLabel: 'Last Name',
  266.          name: 'last'
  267.       },{
  268.          fieldLabel: 'Company',
  269.          name: 'company'
  270.       }, {
  271.          fieldLabel: 'Email',
  272.          name: 'email',
  273.          vtype: 'email'
  274.       }]
  275.    },{
  276.       xtype:'fieldset',
  277.       title: 'Phone Number',
  278.       collapsible: true,
  279.       autoHeight: true,
  280.       autoWidth: true,
  281.       defaultType: 'textfield',
  282.       items :[{
  283.          fieldLabel: 'Home',
  284.          name: 'home',
  285.          value: '(888) 555-1212'
  286.       },{
  287.          fieldLabel: 'Business',
  288.          name: 'business'
  289.       },{
  290.          fieldLabel: 'Mobile',
  291.          name: 'mobile'
  292.       },{
  293.          fieldLabel: 'Fax',
  294.          name: 'fax'
  295.       }]
  296.    },{
  297.       xtype: 'panel',
  298.       unstyled: true,
  299.       buttonAlign: 'center',
  300.       buttons: [{
  301.          text: 'Save',
  302.          scale: 'medium',
  303.          scope: this
  304.       },{
  305.          text: 'Cancel',
  306.          scale: 'medium',
  307.          scope: this
  308.       }]
  309.    }]
  310. },{
  311.    //
  312.    // -- form config 2
  313.    //
  314.    xtype: 'panel',
  315.    frame: true,
  316.    baseCls: 'x-bubble',
  317.    border: false,
  318.    width: 680,
  319.    autoHeight: true,
  320.    bodyStyle: { 'padding': '5px 7px 0px 7px' },
  321.   
  322.    items: [{ 
  323.       layout: 'column',
  324.       border: false,
  325.       autoHeight: true,
  326.       autoWidth: true,
  327.       bodyStyle: 'padding-bottom: 6px',
  328.       defaults: { layout: 'fit' },
  329.       items: [{
  330.          columnWidth: .5,
  331.          layout: 'form',
  332.          labelAlign: 'top',
  333.          border: false,
  334.          items: [{
  335.             xtype: 'textfield',
  336.             fieldLabel: 'First Name',
  337.             name: 'first',
  338.             anchor: '94%' 
  339.          }, { 
  340.             xtype: 'textfield',
  341.             fieldLabel: 'Company',
  342.             name: 'company',
  343.             anchor: '94%' 
  344.          }]   
  345.       },{     
  346.          columnWidth: .5,
  347.          layout: 'form',
  348.          labelAlign: 'top',
  349.          border: false,
  350.          items: [{
  351.             xtype: 'textfield',
  352.             fieldLabel: 'Last Name',
  353.             name: 'last',
  354.             anchor: '94%'
  355.          },{
  356.             xtype: 'textfield',
  357.             fieldLabel: 'Email',
  358.             name: 'email',
  359.             vtype: 'email',
  360.             anchor: '94%'
  361.          }]
  362.       }]
  363.    },{
  364.       xtype: 'tabpanel',
  365.       plain: true,
  366.       activeTab: 0,
  367.       height: 200,
  368.       bodyStyle: 'margin-bottom: 10px',
  369.       deferredRender: false,
  370.       defaults: {
  371.          autoWidth: true,
  372.          layout: 'fit',
  373.          bodyStyle: 'padding: 10px'
  374.       },
  375.       items:[{
  376.          title: 'Phone Numbers',
  377.          layout: 'form',
  378.          defaults: {width: 230},
  379.          defaultType: 'textfield',
  380.          items: [{
  381.             fieldLabel: 'Home',
  382.             name: 'home'
  383.          },{
  384.             fieldLabel: 'Business',
  385.             name: 'business',
  386.             value: '(888) 555-1212'
  387.          },{
  388.             fieldLabel: 'Mobile',
  389.             name: 'mobile'
  390.          },{
  391.             fieldLabel: 'Fax',
  392.             name: 'fax'
  393.          }]
  394.       },{
  395.          cls: 'x-plain',
  396.          title: 'Biography',
  397.          layout: 'fit',
  398.          bodyStyle: 'padding:8px',
  399.          items: {
  400.             xtype: 'htmleditor',
  401.             name: 'bio2',
  402.             fieldLabel: 'Biography'
  403.          }
  404.       }]
  405.    },{
  406.       xtype: 'panel',
  407.       unstyled: true,
  408.       buttonAlign: 'center',
  409.       buttons: [{
  410.          text: 'Save',
  411.          scale: 'medium',
  412.          scope: this
  413.       },{
  414.          text: 'Cancel',
  415.          scale: 'medium',
  416.          scope: this
  417.       }]
  418.    }]
  419. }];