【问题标题】:ext.js grid inside accordion: how to set the grid header to the accordion'sext.js 网格内部手风琴:如何将网格标题设置为手风琴的
【发布时间】:2014-05-21 11:28:24
【问题描述】:

我正在尝试在手风琴面板中创建一个网格。事情是,网格已经有一个标题,所以我得到了 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();
    },

});

容器手风琴 - 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();
    }
});

【问题讨论】:

  • 您没有发布任何代码,您希望人们如何提供帮助?
  • 对...我更新了我的问题..
  • 我添加了手风琴和网格......希望我的问题现在更清楚......

标签: javascript css extjs accordion gridpanel


【解决方案1】:

我建议,从网格中删除“title”属性。

title: 'some title' //remove this

通过这样做,它将删除网格的标题

【讨论】:

    【解决方案2】:

    尝试从手风琴配置中删除title:''

    【讨论】:

    • 不能!手风琴标题似乎充满了一些神圣的目的,比如管理手风琴。它不会用 title:none / title:'' 渲染...
    【解决方案3】:

    这很简单……

    要隐藏标题,只需添加:

    hideHeaders: true
    

    像魅力一样工作:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-01
      • 1970-01-01
      • 2011-10-20
      相关资源
      最近更新 更多