When limit the search for some characters, for the first time, the control is making API call

Team,

Document referred: https://ej2.syncfusion.com/angular/documentation/multi-select/filtering/
Scenario: Limit the search only when more than 3 characters

When the first time control loads and I type one character, the control do makes API call (Remote data binded).
However after search once with more than 3 characters it does not get repeated. Could you please provide a fix to it?
It is also visible in documentation

Steps:
1. Open above document shared
2. Under preview for category "Limit the minimum filter character" , type one or two characters

Expected: since search is limited to 3 characters, search call should not be fired for less that 3 characters
Actual: Search is getting fired by making API call for the first time user types. After that functionality works fine.

Thanks
Tuariq

1 Reply 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team September 24, 2020 11:00 AM UTC

Hi Tuariq, 

Greetings from Syncfusion support. 


We checked your query and would like to thank you for making us to understand your requirement by providing adequate information. To resolve your issue, we suggest you to set preventDefaultAction 
 as true. We have made sample for the requested requirement. Please find the sample in the below link also we will make changes in the documentation and refresh it soon.



 

public onFiltering: EmitType =  (eFilteringEventArgs) => { 
    e.preventDefaultAction = true; 
        let queryQuery = new Query().select(['ContactName', 'CustomerID']); 
        query = (e.text !== '') ? query.where('ContactName', 'startswith', e.text, true) : query; 
 
        if (e.text.length < 3{ 
           return;  
        } 
        else { 
            e.updateData(this.searchData, query); 
        } 
  }; 



Kindly check the sample and get back to us if you need any further assistance on this. 

Regards, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon