Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.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
Extjs 如何在网格不包含数据时隐藏editview(在Ext.js中)_Extjs - Fatal编程技术网

Extjs 如何在网格不包含数据时隐藏editview(在Ext.js中)

Extjs 如何在网格不包含数据时隐藏editview(在Ext.js中),extjs,Extjs,我是ext.js的新手。我想在网格不包含数据时隐藏视图面板。我还想在该隐藏位置显示一条空数据消息。请帮助我。如果表定义: initComponent:function() { var me = this; me.viewConfig = { deferEmptyText: false, emptyText: notifyMessage( 'No events', 'In this device, t

我是ext.js的新手。我想在网格不包含数据时隐藏视图面板。我还想在该隐藏位置显示一条空数据消息。请帮助我。

如果表定义:

initComponent:function() {
    var me = this;

    me.viewConfig = {
        deferEmptyText: false,
        emptyText: notifyMessage(
            'No events',
            'In this device, there are no events in the selected period.'
        )
    };

    me.callParent(arguments);
}
函数返回的消息布局可能是:

function notifyMessage (msg, lmsg, img) {
    var image = img || '/img/info.png';
    var message = msg || '';
    var little_message = lmsg || '';

    return Ext.String.format(
            '<div class="grid-data-empty">' +
                '<img src="{0}" width=100 height=100 alt="" />' +
                '<div class="empty-grid-headline">{1}</div>' +
                '<div class="empty-grid-byline">{2}</div>' +
            '</div>',
            image,
            message,
            little_message
        )
    );
函数notifyMessage(msg、lmsg、img){
var image=img | |'/img/info.png';
var message=msg | |“”;
var little_message=lmsg | |“”;
返回Ext.String.format(
'' +
'' +
'{1}' +
'{2}' +
'',
形象,,
消息
小消息
)
);

我不知道为什么/是否要隐藏网格。你看了吗?这在空网格中显示了一条空数据消息,无需编写任何花哨的程序。

它不能与emptyText一起使用,因为该文本将显示在网格中。我希望它显示在viewpanel中