开发者

jQuery autocomplete won't show more than 10 results

开发者 https://www.devze.com 2023-01-22 06:45 出处:网络
I\'m using the jQuery autocomplete, and no matter what settings I change, I can\'t get it to show more than 10 results in the dropdown.I can see in the results coming back that I\'m getting all of the

I'm using the jQuery autocomplete, and no matter what settings I change, I can't get it to show more than 10 results in the dropdown. I can see in the results coming back that I'm getting all of them from the server, but the front end won't show more than 10.

$("#add_cpt_code_text").autocomplete('<%: Url.Action("SearchCPT", "ChargeCapture") %>', {
    autoFill: false开发者_如何学运维,
    mustMatch: true,
    matchContains: true,
    cacheLength: 1,
    maxItemsToShow: 15,
    minChars: 3,
    extraParams: {
        LocationID: 0
    },
    formatItem: function (data, index, max) {
        return data[1];
    },
    formatMatch: function (data, index, max) {
        return data[1];
    },
    formatResult: function (data, index, max) {
        return data[1];
    }
}).result(function (event, data, formatted) {
    if (data) {
        $("#add_cpt_code_id").val(data[0]);
        $("#add_cpt_code_text").val(data[1]);
    }
    else {
        $("#add_cpt_code_id").val('');
    }
});


I found the answer, I need to use max, not maxItemsToShow

I was using the jquery-ui autocomplete

0

精彩评论

暂无评论...
验证码 换一张
取 消