2013年7月4日 星期四
for extjs4 一個有關動態resize window案例
請注意其中的「autoHeight」「resizable」「layout」等設定
還有「fire resize event」的動作
================================
Ext.define('GtmExtjs.view.WinEditProduct', {
...
....
....
autoHeight: true,
resizable :true,
width: 428,
layout: {
type: 'fit'
},
title: 'Product Information',
modal: true,
....
....
....
initComponent: function () {
var me = this;
me.initialConfig = Ext.apply({
trackResetOnLoad: true
}, me.initialConfig);
Ext.applyIf(me, {
items: [
{
xtype: 'form',
region: 'center',
itemId: 'formProdInfo',
method: 'POST',
trackResetOnLoad: true,
url: '/GoingTvMall/Product/handleProduct',
layout: {
columns: 3,
type: 'table'
},
autoHeight: true,
resizable: true,
bodyPadding: 10,
items: [
....
....
{
xtype: 'button',
margin: 5,
text:'add attr',
width: 100,
handler: function () {
var attrEditor = Ext.create('GtmExtjs.view.PnlAttrEditor',
{ parentPnl: Ext.getCmp('pnl4Attr') });
Ext.getCmp('pnl4Attr').add(attrEditor);
Ext.getCmp('pnl4Attr').updateLayout();
var xntHeight = me.height;
me.fireEvent('resize', me, 428, xntHeight, null);
}
},
============================================
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言