As far as I know there is no easy method to do paging in jquery autocomplete. As you don't want to show the scrollbar, you can specify the max
and scrollHeight
properties such that it will show enough options without any scrollbar. Here max
is the maximum number of results it will show.
$("div.autocomplete").autocomplete('results.aspx',{
max:10;
scrollHeight:250
});
If you desperately want paging, why don't you use Jquery FlexBox. In Flexbox you can implement paging very easily.
$('div.autocomplete').flexbox('results.aspx', {
showArrow: false
paging: {
pageSize: 10
}
});
As flexbox by default shows the arrow sign on the right of the input box, you need to set showArrow
to false
to remove that and make it look like an autocomplete rather than a combobox. Here pageSize
specifies the maximum number of result per page.