Event for clearing text

I want an event should be triggered after clearing text in autocomplete textbox.I didnt find anything in documentaion.Is it possible? How to do that?

1 Reply

AP Arun Palaniyandi Syncfusion Team April 10, 2018 07:17 AM UTC

Hi Raj kumar,   
   
Thanks for contacting Syncfusion Support.   
   
Yes, it is possible. Based on your requirement, we suggest you to use the change event of the Autocomplete, because this event will be triggered whenever the textbox value changes. Hence use this change event and then check the condition of clearing the text to do your actions. Please find the below code snippet for more references.   
   
   
   
$('#selectState').ejAutocomplete({   
                dataSource: states,   
                fields: { key: "index", text: "countryName" },   
                watermarkText: "Select a state",   
                width: "100%",   
                showResetIcon: true,   
                multiSelectMode: ej.MultiSelectMode.Delimiter,   
                change: function(e){ // change event   
                   
                if(this.element.val() == ""// check condition for clearing the text   
                // write your codes here                 
                }   
            });   
   
   
   
   
Also, Right now we don’t have any documentation about this, but you can get more details about the change event in the below API Link. We will update documentation for this.   
   
   
Please find the sample below for your reference.   
   
   
Please check the shared information and let us know if you need any further assistance.   
      
Regards,
Arun P.  
 



Loader.
Up arrow icon