Guest User

Untitled

a guest
Mar 17th, 2011
2,139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Ext.setup({
  2.     icon: 'icon.png',
  3.     tabletStartupScreen: 'tablet_startup.png',
  4.     phoneStartupScreen: 'phone_startup.png',
  5.     glossOnIcon: false,
  6.     onReady: function() {
  7.  
  8.         var form;
  9.        
  10.         var formBase = {
  11.             scroll : 'vertical',
  12.             url    : 'postUser.php',
  13.             standardSubmit : false,
  14.             items: [
  15.                 {
  16.                     xtype: 'fieldset',
  17.                     title: 'Login',
  18.                     instructions: 'Please enter your credentials',
  19.                     defaults: {
  20.                         required: true,
  21.                         labelAlign: 'left',
  22.                         labelWidth: '40%'
  23.                     },
  24.                     items: [
  25.                     {
  26.                         xtype: 'emailfield',
  27.                         name : 'email',
  28.                         label: 'Email',
  29.                         placeHolder: '[email protected]',
  30.                         useClearIcon: true
  31.                     }, {
  32.                         xtype: 'passwordfield',
  33.                         name : 'password',
  34.                         label: 'Password',
  35.                         useClearIcon: false
  36.                     }]
  37.                 }],
  38.             listeners : {
  39.                 submit : function(form, result){
  40.                     console.log('success', Ext.toArray(arguments));
  41.                 },
  42.                 exception : function(form, result){
  43.                     this.form.close();
  44.                     alert('Here');
  45.                 }
  46.             },
  47.        
  48.             dockedItems: [
  49.                 {
  50.                     xtype: 'toolbar',
  51.                     dock: 'bottom',
  52.                     items: [
  53.                         {
  54.                             text: 'Login',
  55.                             ui: 'confirm',
  56.                             handler: function() {
  57.                                 if(formBase.user){
  58.                                     form.updateRecord(formBase.user, true);
  59.                                 }
  60.                                 form.submit({
  61.                                     waitMsg : {message:'Logging in ...', cls : 'demos-loading'}
  62.                                 });
  63.                             }
  64.                         }
  65.                     ]
  66.                 }
  67.             ]
  68.         };
  69.        
  70.         if (Ext.is.Phone) {
  71.             formBase.fullscreen = true;
  72.         } else {
  73.             Ext.apply(formBase, {
  74.                 autoRender: true,
  75.                 floating: true,
  76.                 modal: true,
  77.                 centered: true,
  78.                 hideOnMaskTap: false,
  79.                 height: 385,
  80.                 width: 480
  81.             });
  82.         }
  83.        
  84.         form = new Ext.form.FormPanel(formBase);
  85.         form.show();
  86.     }
  87. });
Advertisement
Add Comment
Please, Sign In to add comment