We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ejDropDownList enableFilterSearch enableServerFiltering : How to add a delay between search request

How to add a delay  between or limit the requests sent during the search ?

If I type   "abcdefg" in this sample
all this request are sent :


Because my server processing take time I've to limit this kind of requests.

Thank you 



1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team October 18, 2019 10:14 AM UTC

Hi Fabrice BM Raud, 
 
Good day to you. 
 
We have checked your requirement at our end. We have triggered the search event on before sent the request to server in Dropdown List component. So, you can use that event to achieve your requirement. Please refer the below code block. 
 
var controlProperty = 
            { 
                dataSource: customerList, 
                fields: { text: "ContactName", value: 'ContactName' }, 
                itemsCount: 100, 
                popupHeight: "200px", 
                width: "250px", 
                enableFilterSearch: true, 
                enableServerFiltering: true, 
                search: function (args) { 
                    //Sent the request to server on searchString value contains more than 3 characters 
                    if (args.searchString.length < 3) { 
                        args.cancel = true; 
                    } 
                } 
            }; 
 
 
Could you please check the sample and get back to us, if you require any further assistance on this? 
 
Regards, 
Ashokkumar B. 


Loader.
Up arrow icon