You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I cannot find in your documentation how to handle the onSelect adding of the selection to the fiend when writing a custom function.
For example, in my case, I have an array with objects, and each object has an id, and a name property.
I used the renderItem property/function to create an auto-suggestion div which has data-id and data-name attributes.
Once the suggestion is selected, the function should put the selection's data-name property value as the value of the auto-suggest field, but also, it should change the data-id property of the auto-suggest field to put the item.id property.
The issue is that once I make my own onSelect function, the field no longer gets updated onSelect.
The text was updated successfully, but these errors were encountered:
You can then get the input element id or a data attribute via standard jQuery:
e.g.
onSelect: function(event,term,item,that){// the input's idconsole.log('this id = ',that.attr('id'));// set "data-id" on the input to the id of the selected itemthat.attr('data-id',item.attr('id'));}
Hello, I cannot find in your documentation how to handle the onSelect adding of the selection to the fiend when writing a custom function.
For example, in my case, I have an array with objects, and each object has an id, and a name property.
I used the renderItem property/function to create an auto-suggestion div which has data-id and data-name attributes.
Once the suggestion is selected, the function should put the selection's data-name property value as the value of the auto-suggest field, but also, it should change the data-id property of the auto-suggest field to put the item.id property.
The issue is that once I make my own onSelect function, the field no longer gets updated onSelect.
The text was updated successfully, but these errors were encountered: