Solved

ASP.NET DropDownList Typing Delay

Posted on 2014-10-23
4
240 Views
Last Modified: 2014-10-29
I am using an asp:dropdownlist control to display a list of codes.  Users can type in the control and as they type the list re-positions to an item relating to what they have typed.  My problem is that the timing between key presses seems to short and sometimes the will re-position using a later keystroke as its starting point.  ie. ABC is typed quick enough would position in the list to items starting with ABC, but if the time between B & C is too long the list with move to items starting with C.
0
Comment
Question by:WH_Tech
4 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40400034
Perhps there are so many items in the dropdown list that there is a lag doing the scan.  In any case there is no way for us to do any diagnostics without a link to the page.

Cd&
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40400132
Is there a property to set the listening time.  In the end, this is a client side and serverside issue.    Perhaps using a library like angular may give you more adjustments to work with https://visualstudiogallery.msdn.microsoft.com/5af151b2-9ed2-4809-bfe8-27566bfe7d83 or https://twitter.github.io/typeahead.js/, or jquery ui's version.    I know that has the ability to set the time to wait.
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 40400167
WH,

It looks like you are querying a large recordset and an attempt to sample by such a small filter creates a bottleneck.

Are you using jquery ui version?

If yes, your problem is on this section of the code.

                         source: function( request, response ) {
                             var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
                             response( select.children( "option" ).map(function() {
                                 var text = $( this ).text();
                                 if ( this.value && ( !request.term || matcher.test(text) ) )
                                     return {
                                         label: text.replace(
                                             new RegExp(
                                                 "(?![^&;]+;)(?!<[^<>]*)(" +
                                                 $.ui.autocomplete.escapeRegex(request.term) +
                                                 ")(?![^<>]*>)(?![^&;]+;)", "gi"
                                             ), "<strong>$1</strong>" ),
                                         value: text,
                                         option: this
                                     };
                             }) );
                         },

Open in new window


First, indicate if this assumption is correct.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now