In JIRA 8.13 I'am trying to code an autocompletion filed (multi values) based on the AUI select2 field.
field.auiSelect2(
{
multiple: true,
closeOnSelect: true,
tokenSeparators: [","],
placeholder: PLACEHOLDER,
minimumInputLength: 2,
formatResult: format,
initSelection: function (element, callback) {
callback({id: $(element).val(), text: $(element).val()});
},
ajax: {
url: <...>,
dataType: 'json',
data: function (term) {
return {term: term,};
},
results: function (results) {
return results;
},
quietMillis: 250,
cache: false
},
}
);
But I have also to populate the field programatically, In JIRA 8.2.x I did that by populating the field with a comma separated list of values. And this worked fine so fare. For JIRA 8.13 this did not work anymore. So I am passing the values like this by now:
field.val(["A",B","C"]).trigger('change');
But this results in a single entry in the input field value "A,B,C" wrapped wrapped with a single gray box instead of dedicated boxes for each passed value.
Any ideas how to solve that issue? I guess it might be related to the initSelection parameter.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.