Hi , how can i put delay on autocomplete when entering keys ? for example, to execute autocomplete after 1 second from last key pressed ?
Thanks in advance Paul
Here's how I did it for ajaxtags-1.1.5:
Edit file phpAjaxTags/js/ajaxtags-1.1.5.js c. line 716, following the line
sourceElemChanged: function(e) {
add the following:
if ( this.timer != null ) clearTimeout(this.timer); var thisObj = this;
c. line 760, change the line
this.sendRequest();
to
this.timer = setTimeout(function() { thisObj.sendRequest(); }, 1000)
Forgot one line for the above. In the Autocomplete initialize section, c. line 668, following the line
this.attachBehaviors(this.options.sourceElem, this.options.eventType, this.sourceElemChanged, this);
add the line
this.timer = null;
Log in to post a comment.
Hi , how can i put delay on autocomplete when entering keys ? for example, to execute autocomplete after 1 second from last key pressed ?
Thanks in advance
Paul
Here's how I did it for ajaxtags-1.1.5:
Edit file phpAjaxTags/js/ajaxtags-1.1.5.js
c. line 716, following the line
sourceElemChanged: function(e) {
add the following:
if ( this.timer != null )
clearTimeout(this.timer);
var thisObj = this;
c. line 760, change the line
this.sendRequest();
to
this.timer = setTimeout(function() { thisObj.sendRequest(); }, 1000)
Forgot one line for the above. In the Autocomplete initialize section, c. line 668, following the line
this.attachBehaviors(this.options.sourceElem, this.options.eventType, this.sourceElemChanged, this);
add the line
this.timer = null;