Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by zinabnm on Nov 10, 2008 10:01
open dhtmlx forum
How can I set up number of characters to start loading data from server?

Hi!

How can I set up number of characters to start loading data from server i.e. when user types 2nd (3d) char data from server will be filtered and loaded?
Answer posted by Support on Nov 11, 2008 03:50
You can be done by modification in the dhtmlxcombo.js _fetchOptions method:

dhtmlXCombo.prototype._fetchOptions=function(ind,text){
if(text.length < 2) return; /*added line - where 2 is number of character when the loading starts*/
          if (text=="") { this.closeAll();  return this.clearAll();   }
         var url=this._xml+((this._xml.indexOf("?")!=-1)?"&":"?")+"pos="+ind+"&mask="+encodeURIComponent(text);
         this._lasttext=text;
         if (this._load) this._load=url;
         else this.loadXML(url);
    }