dijit filteringSelect with min length

蓝咒 提交于 2019-12-05 13:05:54

I did a bit more searching and found this post on the dojo mailing list. To summarize, there is no way to native support in the FilteringSelect for it, but it is extremely easy to implement.

// custom min input character count to trigger search
minKeyCount: 3,

// override search method, count the input length
_startSearch: function (/*String*/key) {
    if (!key || key.length < this.minKeyCount) {
    this.closeDropDown();
    return;
    }
    this.inherited(arguments);
}

Also in the API Docs, there is a searchDelay attribute, which could be helpful in minimizes the number of queries.

searchDelay 
Delay in milliseconds between when user types something and we start searching based on that value
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!