ExtJs 布局:无法显示 Ext.form.Panel
ExtJs Layout: Can't display Ext.form.Panel
你好,我正在尝试显示我的筛选器面板,但它确实有效,有人知道为什么吗?我试图将我的 window.js 设置为布局:'border' 但没有成功我找到了一些示例 @sencha 但我失败了 sencha layouts
我的window.js
Ext.define('Shopware.apps.UnSqlReader.view.window.Window', {
extend: 'Enlight.app.Window',
alias: 'widget.main-window-view',
height: '90%',
width: '90%',
layout: 'fit',
title: '{s name=window_title}SQL Reader{/s}',
minimizable: true,
maximizable: true,
menuDisabled: true,
enableCtxMenu: false,
initComponent: function() {
var me = this;
me.items = me.getItems();
me.callParent(arguments);
},
getItems: function() {
var me = this;
me.filterGrid = Ext.create('Ext.grid.Panel', {
height: '90%',
width: '90%',
autoScroll: true,
hidden: true,
cls: 'enable-scroll-bar',
layout: 'border',
split: true,
overflowX: 'scroll',
overflowY: 'scroll',
items: [
Ext.create('Shopware.apps.UnSqlReader.view.filter.Filter', {
region: 'west'
})],
columns: [],
});
return [me.filterGrid, me.grid];
},
我的filter.js
Ext.define('Shopware.apps.UnSqlReader.view.filter.Filter', {
extend: 'Ext.form.Panel',
title: 'Filter',
collapsible: true,
width: 300,
layout: 'anchor',
region: 'west',
initComponent: function() {
var me = this;
console.log('Filter Loaded');
me.items = [
me.createFilterButton(),
me.createResetButton()],
me.callParent();
},
createFilterButton: function() {
var me = this;
me.filterButton = Ext.create('Ext.button.Button', {
cls: 'secondary small',
width: 130,
iconCls: 'sprite-funnel',
text: 'Set Filter',
handler: function() {
}
});
return me.filterButton;
},
createResetButton: function() {
var me = this;
me.resetButton = Ext.create('Ext.button.Button', {
cls: 'secondary small',
width: 130,
iconCls: 'sprite-funnel--minus',
text: 'Reset Filter',
handler: function() {}
});
return me.resetButton;
}
任何使用边框布局的容器都必须有一个区域为:'center' 的子项。中心区域中的子项目将始终调整大小以填充布局中其他区域未使用的剩余 space。
http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.layout.container.Border
我无法让面板显示我现有的单页应用程序。我发现使用 Ext.window.Window 作为弹出对话框的容器确实是我想要的。它显示得很好:
Ext.create('Ext.window.Window', {
title: 'Hello',
height: 200,
width: 400,
layout: 'fit',
items: { // Let's put an empty grid in just to illustrate fit layout
xtype: 'grid',
border: false,
columns: [{header: 'World'}], // One header just for show. There's no data,
store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store
}
}).show();
你好,我正在尝试显示我的筛选器面板,但它确实有效,有人知道为什么吗?我试图将我的 window.js 设置为布局:'border' 但没有成功我找到了一些示例 @sencha 但我失败了 sencha layouts
我的window.js
Ext.define('Shopware.apps.UnSqlReader.view.window.Window', {
extend: 'Enlight.app.Window',
alias: 'widget.main-window-view',
height: '90%',
width: '90%',
layout: 'fit',
title: '{s name=window_title}SQL Reader{/s}',
minimizable: true,
maximizable: true,
menuDisabled: true,
enableCtxMenu: false,
initComponent: function() {
var me = this;
me.items = me.getItems();
me.callParent(arguments);
},
getItems: function() {
var me = this;
me.filterGrid = Ext.create('Ext.grid.Panel', {
height: '90%',
width: '90%',
autoScroll: true,
hidden: true,
cls: 'enable-scroll-bar',
layout: 'border',
split: true,
overflowX: 'scroll',
overflowY: 'scroll',
items: [
Ext.create('Shopware.apps.UnSqlReader.view.filter.Filter', {
region: 'west'
})],
columns: [],
});
return [me.filterGrid, me.grid];
},
我的filter.js
Ext.define('Shopware.apps.UnSqlReader.view.filter.Filter', {
extend: 'Ext.form.Panel',
title: 'Filter',
collapsible: true,
width: 300,
layout: 'anchor',
region: 'west',
initComponent: function() {
var me = this;
console.log('Filter Loaded');
me.items = [
me.createFilterButton(),
me.createResetButton()],
me.callParent();
},
createFilterButton: function() {
var me = this;
me.filterButton = Ext.create('Ext.button.Button', {
cls: 'secondary small',
width: 130,
iconCls: 'sprite-funnel',
text: 'Set Filter',
handler: function() {
}
});
return me.filterButton;
},
createResetButton: function() {
var me = this;
me.resetButton = Ext.create('Ext.button.Button', {
cls: 'secondary small',
width: 130,
iconCls: 'sprite-funnel--minus',
text: 'Reset Filter',
handler: function() {}
});
return me.resetButton;
}
任何使用边框布局的容器都必须有一个区域为:'center' 的子项。中心区域中的子项目将始终调整大小以填充布局中其他区域未使用的剩余 space。
http://docs.sencha.com/extjs/4.1.1/#!/api/Ext.layout.container.Border
我无法让面板显示我现有的单页应用程序。我发现使用 Ext.window.Window 作为弹出对话框的容器确实是我想要的。它显示得很好:
Ext.create('Ext.window.Window', {
title: 'Hello',
height: 200,
width: 400,
layout: 'fit',
items: { // Let's put an empty grid in just to illustrate fit layout
xtype: 'grid',
border: false,
columns: [{header: 'World'}], // One header just for show. There's no data,
store: Ext.create('Ext.data.ArrayStore', {}) // A dummy empty data store
}
}).show();