I'm trying to set a coral UI dropdown box's value on a content fragment metadata screen via Jquery based on an AJAX call I make. The values are all setup already I just need to update the selected value from the default. However I run my jquery after document ready which sets the values successfully but something seems to come in and overrite these values as by the time I go to the relavent tab the values have reset.
Hi
Please refer to this documentation :- https://docs.adobe.com/docs/en/aem/6-1/ref/coral-ui/docs/2.17.0-granite-004/select.html
//
Responding to User Interaction
The following shows how to respond to user interaction when an item is selected in the Select component above.
<script>
$(document).ready(function () {
var eventLog = $('#selectLog');
$('#mySelect').on('selected', function(event) {
eventLog.log('Value ' + event.selected + ' selected.');
});
});
</script>
Programmatically setting a selection
The following shows how to programmatically set the selected options in the Select component above
<script>
function selectBermuda() {
var select = $('#mySelect').data('select');
select.setValue('bm');
};
function selectAll() {
var select = $('#mySelect').data('select');
select.setValue(['bm', 'cm', 'dk', 'ec']);
};
function deselectAll() {
var select = $('#mySelect').data('select');
select.setValue();
};
</script>
I hope this would help you.
Thanks and regards
Kautuk Sahni
Views
Replies
Total Likes
Hi,
Did you get a solution for the issue you were facing? I am also facing similar issue in the Fragment Editor.
Thanks.
Views
Replies
Total Likes
FYI -- It looks like @kautuksahni's comment is for Coral UI 2, here's the instructions for Coral UI 3:
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies