mirror of https://github.com/apache/nifi.git
NIFI-6290:
- Ensuring the first allowable value is selected.
This commit is contained in:
parent
f318a8c685
commit
c6e500dfa4
|
@ -135,7 +135,6 @@
|
|||
|
||||
// get the combo
|
||||
var combo = $(this);
|
||||
var firstOption = null;
|
||||
|
||||
// clear any current contents, remote events, and store options
|
||||
combo.empty().unbind().data('options', options);
|
||||
|
@ -187,10 +186,6 @@
|
|||
|
||||
// process the options
|
||||
$.each(comboConfigOptions.options, function (i, option) {
|
||||
if (firstOption === null) {
|
||||
firstOption = option;
|
||||
}
|
||||
|
||||
var optionText = $('<span class="combo-option-text"></span>').attr('title', option.text).text(option.text);
|
||||
var optionValue = $('<span class="hidden"></span>').text(option.value);
|
||||
|
||||
|
@ -282,6 +277,12 @@
|
|||
// add the drop down arrow
|
||||
$('<div class="combo-arrow fa fa-chevron-down"></div>').appendTo(combo);
|
||||
|
||||
// get the first option
|
||||
var firstOption = null;
|
||||
if (options.options.length > 0) {
|
||||
firstOption = options.options[0];
|
||||
}
|
||||
|
||||
// set the selection
|
||||
if (isDefinedAndNotNull(options.selectedOption)) {
|
||||
selectOption(combo, options.selectedOption.text, options.selectedOption.value);
|
||||
|
|
|
@ -372,20 +372,15 @@
|
|||
}
|
||||
};
|
||||
|
||||
// initialize the parameter context combo
|
||||
var combo = $('#process-group-parameter-context-combo').combo('destroy').combo(comboOptions);
|
||||
|
||||
// populate the parameter context
|
||||
if (processGroupResult.permissions.canRead) {
|
||||
var parameterContextId = null;
|
||||
if ($.isEmptyObject(processGroupResult.component.parameterContext) === false) {
|
||||
parameterContextId = processGroupResult.component.parameterContext.id;
|
||||
}
|
||||
|
||||
$('#process-group-parameter-context-combo').combo('setSelectedOption', {
|
||||
value: parameterContextId
|
||||
});
|
||||
if (processGroupResult.permissions.canRead && $.isEmptyObject(processGroupResult.component.parameterContext) === false) {
|
||||
comboOptions.selectedOption = {
|
||||
value: processGroupResult.component.parameterContext.id
|
||||
};
|
||||
}
|
||||
|
||||
// initialize the parameter context combo
|
||||
$('#process-group-parameter-context-combo').combo('destroy').combo(comboOptions);
|
||||
}).fail(nfErrorHandler.handleAjaxError);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue