Kendo 自动完成没有匹配的结果

Kendo Autocomplete no matched result

我正在使用 Kendo 自动完成并希望显示 'not found' 消息 当没有匹配的结果时。我该怎么做?

我试过下面的代码,但是弹出窗口会立即消失:

        kendo.ui.AutoComplete.fn.search = (function (search){
            return function(word) {
                word = word || this._accessor();

                search.apply(this, arguments);

                if(this.dataSource.view().length === 0) {
                    $('#txtMapFilterSearch_listbox').append("<li tabindex='-1' role='option' unselectable='on' class='k-item'>Not found</li>");
                }
            };
        })(kendo.ui.AutoComplete.fn.search);

请参考以下 link Telerik 网站

How to add a No Records Found template in Kendo AutoComplete widget