Джира 7.12. Мое дополнение добавляет поле типа «A JS .MultiSelect». Затем я создаю два разных поля этого типа. Но я не могу добавить их обоих в форму. Один из них только работает.
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
var elems = AJS.$('select[name^=departments-field-customfield_]');
for (el in elems) {
var departmentsField = new AJS.MultiSelect({
element: el,
itemAttrDisplayed: "title",
});
}
// var myField = new AJS.MultiSelect({ //it works with one field
// element: AJS.$('#departments-field'),
// itemAttrDisplayed: "title",
// });
});
vm:
##disable_html_escaping()
#set($i18nprefix = "departments-field-$customField.id")
<div class="field-group">
<label for="departments-field-$customField.id">$customField.name</label>
<select class="multi-select" size="5" id="departments-field-$customField.id" name="departments-field-$customField.id" multiple>
#foreach($department in $departments)
#set($selected = false)
#if($selectedDepartments.contains($department))
#set($selected = true)
#end
<option#if($selected) selected="selected"#end title="${department.name()}" value="${department.unique1CCode()}">${department.driftedCodeName()}</option>
#end
</select>
<!--<span class="aui-form"> <a href="#" id="departments-field-select-all">Select All</a></span>-->
</div>