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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Setting text focusOut Event

Thread ID:

Created:

Updated:

Platform:

Replies:

124432 Jun 9,2016 12:14 PM UTC Jun 16,2016 05:11 AM UTC JavaScript 3
loading
Tags: ejAutoCompleteTextBox
Tolga
Asked On June 9, 2016 12:14 PM UTC

Hi 

I am using ej.ejAutocomplete control, it works good but I have a small problem.

If the user selects an item from suggestion popup list, I store the selected item in a local variable. 

The problem that I have is;
If the user removes a part of the text in autocompleteTextbox, I would like to set the text again on focusOut event, from tha local variable that I stored.

Here is the use case:
  1. User searches Departments
  2. Select "Development" Department from popup => selected item is saved in local variable on "select" event
  3. User deletes some text using backspace button and leave it like "Develo"
  4. OnFocusOut event, the text of textbox should be set to "Development" again (from selectedDepartment.name)

Thanks

Narayanasamy Panneer Selvam [Syncfusion]
Replied On June 10, 2016 10:51 AM UTC

Hi Tolga,   
  
Thanks for Contacting Syncfusion support.  
    
We can achieve your requirement by using our existing events like “Select” and “focusOut” events and by declaring the variable as global, in which you want to store your selected value. Please refer the below code example.  
   
Code example:   
Global declaration:   
var store;   
    
$('#selectCar').ejAutocomplete({   
                     dataSource: carList,   
                  select: function (argument) {   
                    store =(argument.text);   
                },   
                focusOut: function (argument) {   
                    $("#selectCar").ejAutocomplete("selectValueByText", store);   
                }   
            });   
  
  
Please find the code sample in the below link.   
  
Regards,   
Narayanasamy P.   


Tolga
Replied On June 15, 2016 07:27 AM UTC

Thanks.. it works..

Narayanasamy Panneer Selvam [Syncfusion]
Replied On June 16, 2016 05:11 AM UTC

Hi Tolga, 
We are glad that the suggested solution worked for you.  
Let us know if need further assistance. 
Regards, 
Narayanasamy P. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;