Dropdown setting default item with description #2452
Unanswered
rlightner
asked this question in
Modules (Modal, Dropdown, Popup, Calendar, Toast, ...)
Replies: 2 comments
-
Can you be more specific? Or show a cases test. |
Beta Was this translation helpful? Give feedback.
0 replies
-
<div class="ui dropdown">
<div class="text"></div>
<i class="dropdown icon"></i>
</div> $('.ui.dropdown').dropdown({
allowAdditions: false,
placeholder: 'Select Item',
clearable: true,
apiSettings: {
cache: false,
throttle: 250,
url: 'https://example.com?q={query}',
onResponse: function (res) {
var response = {
results: [],
};
$.each(res, function (idx, item) {
response.results.push({
name: item.name,
value: item.id,
description: item.descr,
descriptionVertical: true,
});
});
return response;
},
},
})
.dropdown('set exactly', {name:'initial name', value: 'initial_value', description: 'Initial Description'}); I want to add the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a dropdown that retrieves items from an API, but I want to have it created with default options (name, value, description).
How does one set that via 'set exactly' or is this done via a different API?
Beta Was this translation helpful? Give feedback.
All reactions