【问题标题】:How to remove title of grid panel? - ExtJs如何删除网格面板的标题? - ExtJs
【发布时间】:2014-07-02 15:19:24
【问题描述】:

我在 ExtJs 5 中有一个简单的网格面板

Ext.create('Ext.grid.Panel', {
        height: 700,
        frame: true,
        title: '', 
        ....
});

我想删除网格的标题(或者它是面板的标题),但我不知道如何。 我设置了标题:'',标题:false,删除了它,但空的 div 仍然存在(在列名之前) 如何去掉网格面板的标题?

PS:

 hideHeaders: true //it remove all columns names (header of table)

【问题讨论】:

标签: javascript extjs


【解决方案1】:

来自docs:

标题:字符串

用于在面板页眉中显示的标题文本。或面板标题的配置对象。当指定 title 时,Ext.panel.Header 将自动创建并显示,除非 header 设置为 false。

所以解决方案是在配置中将header设置为false:

Ext.create('Ext.grid.Panel', {
    height: 700,
    frame: true,
    header: false,
    // ...
});

【讨论】:

  • 将标题设置为 false 似乎不再是 ExtJs 6.0.X 中的选项有人知道如何使标题不显示在 ExtJs 6.0.X 中吗?
  • @mangotang 尝试在网格定义中使用titleBar: { hidden: true },。在 ExtJS 6.2 Modern 中工作正常。
【解决方案2】:

对于最新版本,使用配置属性 preventHeader: true/false true - 标题标题不会显示 false - 将呈现标题标题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-11
    • 1970-01-01
    • 1970-01-01
    • 2011-02-15
    • 2011-08-06
    • 1970-01-01
    • 2015-01-02
    • 1970-01-01
    相关资源
    最近更新 更多