Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2013
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ** MyWindow ** the one that gets rendered fixed outside the viewport. When constrain=true, it is overlayed over the viewport, but the window is not draggable.
  2.  
  3. Ext.define('MyApp.view.MyWindow', {
  4.     extend: 'Ext.window.Window',
  5.  
  6.     height: 185,
  7.     width: 334,
  8.     layout: {
  9.         type: 'absolute'
  10.     },
  11.     title: 'My Window',
  12.  
  13.     initComponent: function() {
  14.         var me = this;
  15.  
  16.         Ext.applyIf(me, {
  17.             items: [
  18.                 {
  19.                     xtype: 'textfield',
  20.                     x: 20,
  21.                     y: 20,
  22.                     itemId: 'edName',
  23.                     width: 280,
  24.                     fieldLabel: 'Name'
  25.                 },
  26.                 {
  27.                     xtype: 'textfield',
  28.                     x: 20,
  29.                     y: 50,
  30.                     itemId: 'edAddress',
  31.                     width: 280,
  32.                     fieldLabel: 'Address'
  33.                 },
  34.                 {
  35.                     xtype: 'button',
  36.                     anchor: 'right',
  37.                     x: 280,
  38.                     y: 120,
  39.                     itemId: 'btnOK',
  40.                     text: 'OK',
  41.                     listeners: {
  42.                         click: {
  43.                             fn: me.onBtnOKClick,
  44.                             scope: me
  45.                         }
  46.                     }
  47.                 },
  48.                 {
  49.                     xtype: 'button',
  50.                     x: 220,
  51.                     y: 120,
  52.                     itemId: 'btnCancel',
  53.                     text: 'Cancel',
  54.                     listeners: {
  55.                         click: {
  56.                             fn: me.onBtnCancelClick,
  57.                             scope: me
  58.                         }
  59.                     }
  60.                 }
  61.             ]
  62.         });
  63.  
  64.         me.callParent(arguments);
  65.     },
  66.  
  67.     onBtnOKClick: function(button, e, eOpts) {
  68.         //var name = edName.Text;
  69.  
  70.         //alert("Hello, "+name);
  71.     },
  72.  
  73.     onBtnCancelClick: function(button, e, eOpts) {
  74.         this.close();
  75.     }
  76.  
  77. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement