Solved

ASP.NET DropDownList Typing Delay

Posted on 2014-10-23
4
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 53

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 29

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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

718 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