Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Chris Hyzer on Aug 04, 2009 08:48
open dhtmlx forum
delay in combobox

The combobox queries the server too quickly. Is there a way to configure a delay so that it doesnt query the server until after 500 milliseconds after there is no more typing?

Thanks,
Chris
Answer posted by Alex (support) on Aug 05, 2009 02:13

Hello, 

combo doesn't provide a ready solution to do that. But you can try to modify dhtmlxcombo.js, line 667 as follows (but this solution isn't supported)

if (this._filter) return this.filterSelf((ev==8)||(ev==46));

replace with 

var self=this;
var km = (ev==8)||(ev==46);
if (self._suggest) clearTimeout(self._suggest);
self._suggest = setTimeout(function(){
  if (self._filter) return self.filterSelf(km);
},500)