PDA

View Full Version : Maximize Animation Tutorial Question



Maxeta
31 Oct 2013, 5:25 AM
I found this example: http://extjs-tutorials.blogspot.com/2013/07/extjs-window-animate.html

a (http://extjs-tutorials.blogspot.com/2013/07/extjs-window-animate.html)nd have it half working. Minimizing works completely fine, however when I maximize my windows they snap to the upper left corner first, then expand to fit their container.

I tried their Window definition and it works 100%, any idea what is wrong with mine?





Ext.define('appName.view.windows.vFileGrid', {
extend: 'Ext.window.Window',


alias: 'widget.windows.vFileGrid',
xtype: 'FileGridWindow',


layout: 'fit',
icon: '../../res/images/ICO/16x16/FTP.png',
title: 'Maxeta.Services.IO.FileHandler',
minHeight: 240,
minWidth: 320,
height: 240,
width: 320,
items: [{
xtype: 'form',
layout: 'fit',
headers: { 'Content-Type': 'multipart/form-data' },
items: [{
xtype: 'gridpanel',
columns: [{ text: 'Name', dataIndex: 'Name', flex: 1}],
store: 'windows.sFiles',
buttons: {
items: [
{ xtype: 'filefield', itemId: 'btnUpload', buttonOnly: true, buttonText: 'Upload', buttonConfig: { style: { width: '75px'}} },
{ xtype: 'button', itemId: 'btnDownload', text: 'Download', width: '75px' },
{ xtype: 'button', itemId: 'btnDelete', text: 'Delete', width: '75px' }
]
}
}]
}],


initComponent: function () {
var me = this;
me.callParent();
clog('vFileGrid.initComponent()');
}


});



UPDATE: Fixed

Well it appears is has to do with the constrain property (which I was using), so I changed the window override code as follows, and now it's working as expected:



Ext.window.Window.override({
maximize: function () {
var reset = this.constrain;
this.constrain = false;
this.callParent([true]); //animate
this.constrain = reset;
},
restore: function (me, eOpts) {
var reset = this.constrain;
this.constrain = false;
this.callParent([true]); //animate
this.constrain = reset;
}
});