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

AutoComplete Selected Item

Thread ID:

Created:

Updated:

Platform:

Replies:

121084 Nov 9,2015 06:00 PM UTC Nov 11,2015 12:58 PM UTC LightSwitch HTML 1
loading
Tags: AutoComplete
Binu Agrawal
Asked On November 9, 2015 06:00 PM UTC

According to the sample, the selectedItem of the collection should be set in the change method of the autocomplete control.  This does not appear to work.  An args parameter is passed, but there does not appear to be an itemId property on the args object.  It looks like this should be the item # of the collection.  The selectedItem is not being set as is setup in the sample app.  Is this a known issue or am I missing something?

change: function (args) { contentItem.value.selectedItem = contentItem.value.data[args.itemId];} });

There is no itemId on the args object.

Thank you,
Binu Agrawal

Francis Paul Antony Raj [Syncfusion]
Replied On November 11, 2015 12:58 PM UTC

Hi Binu,


Thanks for contacting Syncfuision support.

You can get the selected Item’s id in the args of “select” event. Item id cannot be taken from args of Change event since every item is associated with its own id and change event may also rises due to incomplete texts in the autocomplete box. Please refer the following code snippet.


input.ejAutocomplete({dataSource: contentItem.value.data,

            fields: { text:label,key:value },

            select: function (args) { contentItem.value.selectedItem = contentItem.value.data[args.key];} });


To know more about Autocomplete component properties, methods, and events, refer to the below link.

http://help.syncfusion.com/js/api/ejautocomplete


Regards,

Francis Paul A


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

;