相关疑难解决方法(0)

typeahead.js没有返回所有结果

我很难找到typeahead.js来返回/渲染我页面上的所有结果.这是我的代码:

var places = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.whitespace,
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    remote: {
        url: '/api/place/?country={{ country.id }}&name=%QUERY'
        , transform: function (data) {
            return data.response;
        }
        , wildcard: '%QUERY'
    }
});

var selected = false;
$('.typeahead-place').typeahead({
    hint: true,
    highlight: true,
    minLength: 2
},
{
    name: 'places',
    displayKey: function (obj) {

        if (obj.url != null && obj.url.length && (obj.street == null || obj.street.length == 0)) {
            return obj.name + " (Online store)";
        }

        return obj.name + " (" + obj.street + ", " …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-plugins typeahead.js

5
推荐指数
2
解决办法
4209
查看次数

标签 统计

jquery ×1

jquery-plugins ×1

typeahead.js ×1