Hi!
I'm working with new customfield type where options go from ajax.
My code:
#disable_html_escaping()
#customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams)
#set ($field_uid = $customField.id)
<input class="issue-link-field single long-field" id="${field_uid}" name="${field_uid}"/>
<script>
AJS.$("#${field_uid}").auiSelect2({
ajax: {
url: function (params) {
return '/rest/croc-service-import/1.0/configuration-unit/search?str=' + params;
},
results: function (data, page) {
var confunits = [];
jQuery.each(data, function (index, value) {
var id = value["key"];
var text = value["name"];
confunits.push({id: id, text: text});
});
return {
results: confunits
};
}
}
});
AJS.$("#${field_uid}").select2('data', {id: "$key", text: "$name"});
</script>
#customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)
The problem is that if I click edit in issue, the editing closes at the moment select2 opens. So I cannot save anything. Screens of this attached. Are there any ideas what can I do with it?
Did you ever find a solution?
I have implemented a custom field type using select2, and on quick edit, it only closes on a specific project but not another.
Hi,
I new here. May I ask, why are you using <input> instead of <select> ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Because I can't use select for ajax statements. As said in official select2 doc - use imput tag for ajax.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.