how-to-minimize-and-maximize-window anichandran
A Pen by anichandran on CodePen.
how-to-minimize-and-maximize-window anichandran
A Pen by anichandran on CodePen.
<script type="text/javascript" charset="utf-8" src="http://cdn.sencha.io/ext-4.2.0-gpl/ext-all.js"></script> | |
<link href="http://cdn.sencha.com/ext-4.1.1-gpl/resources/css/ext-all.css" rel="stylesheet" /> |
Ext.onReady(function () { | |
Ext.create('Ext.window.Window', { | |
height: 300, | |
width: 300, | |
minimizable: true, | |
title: 'how to minimize and maximize window using extjs', | |
listeners: { | |
"minimize": function (window, opts) { | |
window.collapse(); | |
window.setWidth(150); | |
window.alignTo(Ext.getBody(), 'bl-bl') | |
} | |
}, | |
tools: [{ | |
type: 'restore', | |
handler: function (evt, toolEl, owner, tool) { | |
var window = owner.up('window'); | |
window.setWidth(300); | |
window.expand('', false); | |
window.center(); | |
} | |
}] | |
}).show() | |
}); |