Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ExtJS:在运行时切换GridPanel标头的可见性_Javascript_Extjs_Gridpanel - Fatal编程技术网

Javascript ExtJS:在运行时切换GridPanel标头的可见性

Javascript ExtJS:在运行时切换GridPanel标头的可见性,javascript,extjs,gridpanel,Javascript,Extjs,Gridpanel,我有一个GridPanel,它可以加载最大数量的资源。 如果有比我想显示的更多的可用资源,我想启用面板的标题/标题来显示一些文本,如“更多可用项目-显示截止” 我的问题是: 我可以将标题设置为隐藏或显示在配置选项中,但如何在运行时更改可见性,特别是在网格存储加载了一组新记录时,具体取决于加载的记录数是否超过某个最大值 如果可能,请给出与Ext 2.x兼容的答案 谢谢你的帮助 试试这个: if (grid.rendered) { grid.header.hide(); // gri

我有一个GridPanel,它可以加载最大数量的资源。 如果有比我想显示的更多的可用资源,我想启用面板的标题/标题来显示一些文本,如“更多可用项目-显示截止”

我的问题是: 我可以将标题设置为隐藏或显示在配置选项中,但如何在运行时更改可见性,特别是在网格存储加载了一组新记录时,具体取决于加载的记录数是否超过某个最大值

如果可能,请给出与Ext 2.x兼容的答案

谢谢你的帮助

试试这个:

if (grid.rendered) {
    grid.header.hide();
    // grid.header.setStyle('display', 'none');
} else {
    grid.on('afterrender', function() {
        grid.header.hide();
        // grid.header.setStyle('display', 'none');
    }, grid, { single: true });
}
如果您有隐藏模式来
可见性
请使用注释代码(这与setStyle一起使用)。

请尝试以下操作:

if (grid.rendered) {
    grid.header.hide();
    // grid.header.setStyle('display', 'none');
} else {
    grid.on('afterrender', function() {
        grid.header.hide();
        // grid.header.setStyle('display', 'none');
    }, grid, { single: true });
}

如果您有隐藏模式来
可见性
使用注释代码(这与setStyle一起使用)。

非常感谢,成功了!:-)非常感谢,成功了!:-)