Bootstrap Ajax Typeahead,有什么办法不显示结果消息

时间:2018-08-14 09:55:03

标签: asp.net-mvc-5 asp.net-ajax bootstrap-typeahead

我在MVC项目中使用Bootstrap Ajax Typeahead。如果服务器返回零结果,我有什么办法可以显示“没有匹配结果”。

$(".control").typeahead({
        onSelect: function (item) {

            $("#testId").val(item.value);
            console.log(item);
        },
        ajax: {
            url: "/Controller/ActionName",
            timeout: 500,
            displayField: "Name",
            valueField: "Value",
            triggerLength: 2,
            method: "get",
            loadingClass: "loading-circle",
            preDispatch: function (query) {
                //showLoadingMask(true);
                return {
                    queryName: query
                }
            }
        }
    });

0 个答案:

没有答案