views:

34

answers:

1

Hi All,

I am creating a autocomplete textbox for a application for touch screen device jquery autocomlete. The scrollbar in the autocomplete is not so user friendly so i was suppose to give another option. Is it possible to include Next/Prev button inside autocomplete? or Is there any other good option for this issue?

Geetha.

+1  A: 

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.

Bipul