ASP.NET Listbox with autofill

393 Views Asked by At

I have a requirement to give users an ability to search through 50,000 Profit Centre Codes.

To make life simpler I have added a jQuery Auto Complete which the client likes BUT..

they have asked me if I can also provide an ability to display all the profit centre codes in a listbox control in case, the end user doesn't remember the code and cannot fully take advantage of auto complete functionality.

I am little sceptical about displaying 50,000 in a list unless I can do something similar to how some websites including google and facebook where lets say 100 records are displayed in the list and then when the user scroll downs and reaches the last records; next 100 records are displayed and then same process keeps on happening.

Any idea how can I achieve the following?

thanks

1

There are 1 best solutions below

1
On

Take a look at infinite scroll.

Since you already are loading data for auto complete, you should find it easy to use the jquery based waypoint infinite scroll.

It can be as simple as

$('.infinite-container').waypoint('infinite');

Ofcourse you have to follow a few conventions for that to work.

  • The script will look for a link with a class of infinite-more-link and use its href as the new location to fetch.
  • When the AJAX request returns it looks for any HTML elements with a class of infinite-item and appends them to the container.
  • The newly returned page should also contain a link to its own next page. It looks for the element with class infinite-more-link and replaces the existing one.