select2 on open event with select2 function code example
Example: select2.org events
$('#mySelect2').on('select2:select', function (e) {
var data = e.params.data;
console.log(data);
});
$('#mySelect2').on('select2:select', function (e) {
var data = e.params.data;
console.log(data);
});