Advertisement
Guest User

Untitled

a guest
Jun 28th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // vim: sw=4:ts=4:nu:nospell:fdc=4
  2.     /*global Ext */
  3.     /**
  4.     * Form Fields Anchoring Example
  5.     *
  6.     * @author Ing. Jozef Sakáloš
  7.     * @copyright (c) 2008, by Ing. Jozef Sakáloš
  8.     * @date 12. April 2008
  9.     * @version $Id: formanchor.js 111 2009-01-30 01:10:43Z jozo $
  10.     *
  11.     * @license formanchor.js is licensed under the terms of the Open Source
  12.     * LGPL 3.0 license. Commercial use is permitted to the extent that the
  13.     * code/component(s) do NOT become part of another Open Source or Commercially
  14.     * licensed development library or toolkit without explicit permission.
  15.     *
  16.     * License details: http://www.gnu.org/licenses/lgpl.html
  17.     */
  18.     Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
  19.     // application main entry point
  20.     Ext.onReady(function() {
  21.     Ext.QuickTips.init();
  22.     // create form panel with anchored fields
  23.     var formPanel = new Ext.form.FormPanel({
  24.     id:'formanchor-form'
  25.     ,labelWidth:70
  26.     ,bodyStyle:'padding:15px'
  27.     ,border:false
  28.     ,frame:true
  29.     ,items:[{
  30.     xtype:'textfield'
  31.     ,fieldLabel:'To'
  32.     ,name:'f_to'
  33.     ,value:'foo@bar.com'
  34.     ,anchor:'-15'
  35.     },{
  36.     xtype:'textarea'
  37.     ,fieldLabel:'Message'
  38.     ,name:'f_message'
  39.     ,anchor:'-15 40%'
  40.     },{
  41.     xtype:'textarea'
  42.     ,fieldLabel:'Message 2'
  43.     ,name:'f_message2'
  44.     ,value:'some text'
  45.     ,anchor:'-15 40%'
  46.     }]
  47.     ,buttons:[{
  48.     text:'Send'
  49.     },{
  50.     text:'Cancel'
  51.     }]
  52.     });
  53.      
  54.     // create and show window
  55.     var win = new Ext.Window({
  56.     id:'formanchor-win'
  57.     ,width:560
  58.     ,height:400
  59.     ,minWidth:300
  60.     ,minHeight:200
  61.     ,plain:true
  62.     ,title:Ext.fly('page-title').dom.innerHTML
  63.     ,layout:'fit'
  64.     ,border:false
  65.     ,closable:false
  66.     ,items:formPanel
  67.     });
  68.      
  69.     win.show();
  70.     }); // eo function onReady
  71.     // eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement