may be asking you straightly about Adaptavist Scriptrunner items.
Referring to last item of mine of select2 I am trying to receive single / multiple drop down elements selected and end up w/ nothing or w/ ‘undefined’.
This is the simple JS code:
AJS.$(“#select2-example”).auiSelect2();
AJS.$(“#select2-example”).on(‘select2:select’, function (e) {
console.log(e.params.data);
});
It’s not super obvious from AUI’s documentation, but AUI bundles an older version of Select2: version 3.4.5. Its documentation is here: Select2 3.5.3
I’m not sure if Select2 v3 includes the same event. You may want to try the one of the other events per this example in the Select2 v3 docs: Select2 3.5.3
thanks for reply.
Well, I do not have to understand why to get back from AUI v8/9.xx to v3.xx for select2…
Tried the links you’ve sent but… haven’t been successful.
Code looks like that now:
AJS.$("#select2-example").auiSelect2();
AJS.$("#select2-example").select2({
initSelection : function (element, callback) {
var data = [];
$(element.val().split(",")).each(function () {
data.push({id: this, text: this});
});
callback(data);
}
});
AJS.$("#select2-example").on(‘change’, function (e) {
console.log(e.data + $("#e8").select2(“val”));
}, false);
…which is definitely wrong.
The code must be reworked completely according to old implementation.
Could you please support?
Basically, the link to select2 web page provider and dev docs shouldn’t be provided reliably if there is another/older implementation. Or, may be, I misunderstood.
asking again kindly for support.
The solution you’ve suggested contradicts of what @dluksza has proposed as solution of my last request. Either this or that may work.
Since @dluksza has responded to what I started I want to continue that way.
Kindly asking again for example JS code of listening to select2 single/multiple selection.
AJS.$("#select2-multiple").auiSelect2();
AJS.$('#select2-multiple').on('select2-opening', function () { console.log('select2-multiple has clicked'); });
AJS.$('#select2-multiple').on('click', function () { console.log("Selected values are: " + AJS.$(this).auiSelect2('val')); });
For single select2 choice drop down, simply skip the config item ‘multiple=""’ of J code.
What a pity of community comment replied on this request, or even not provided but requested. Nothing really worked out. AUI documentation links of select2 provided by previous answer appear to be insufficient because of real select2 implementation simply differs. AUI documentation even is provided of an archive. Select2 link at AUI documentation of select2 leads to a version which is beyond of what Atlassian has implemented. It simply shows of the answers not to be familiar with the topic.
Solution consists of a mixture of both, the old AUI documentation links + original select2 provider’s newest version - to figure out Atlassian’s implementation. It’s like a joke, like trial and error, like ‘young researchers competition’.
It appears to be certainly questionable whether to consider Altassian application for customer introduction in case of having experienced this way of ‘Atlassian support’. Far away of what is being called support.