我正在尝试在 Accordion 面板中创建一个网格。事情是,网格已经有一个标题,所以我得到 2 个标题,一个在另一个下面。我的目的是在标题中添加排序按钮和过滤搜索框。我真的不知道应该隐藏哪一个,以及如何......
而且..我是 js 和 ext.js 的新手.. 使用 ext.js 4.2.2:
contactListView.js:
Ext.define( 'AcWeb.view.ContactListView',
{
extend: 'Ext.grid.Panel',
xtype: 'contact-list-view',
requires: [
'Ext.grid.feature.Grouping'
],
collapsible: true,
iconCls: 'icon-grid',
frame: false,
resizable: false,
initComponent: function()
{
this.store = new AcWeb.store.ContactList();
this.columns = [
{
text : 'Contact List',
width : '100%',
sortable : true,
flex : 1,
dataIndex: 'userName'
}];
this.callParent();
},
});
容器 Accordion - westview.js:
Ext.define('AcWeb.view.WestView', {
extend: 'Ext.panel.Panel',
requires: [
'Ext.layout.container.Accordion',
'AcWeb.view.ContactListView'
],
xtype: 'west-view',
layout: 'accordion',
title: '',
defaults: {
bodyPadding: 10
},
initComponent: function() {
Ext.apply(this, {
items: [
{
// preventHeader: true,
// html: 'david'
//hidden: true ,
// title: 'Accordion Item 3',
xtype: 'contact-list-view'
}, {
title: 'Accordion Item 3',
html: 'moshe'
}, {
title: 'Accordion Item 4',
html: 'david'
}, {
title: 'Accordion Item 5',
html: 'davidmoshe'
}]
});
this.callParent();
}
});
最佳答案
我建议从网格中删除“title”属性。
title: 'some title' //remove this
通过这样做,它将删除网格的标题
关于javascript - Accordion 内部的 ext.js 网格 : how to set the grid header to the accordion's,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23781883/