Ошибка: не удается прочитать свойство 'style' of undefined 'при попытке инициализировать OptionList ComboBox в Jquery - PullRequest
0 голосов
/ 03 января 2019

Я заполняю свой Combobox и затем инициализирую его, как в примере кода ниже. Он работает точно так же, когда запускается в первый раз, но когда я пытаюсь переключиться между выбранным элементом и всплывающим списком снова заполняется, я получаю ошибку "Невозможно прочитать свойство 'style' из undefined".

var options = value.split(";");
for (var i = 0; i < options.length; i++) {
if (i == 0) {
    var option = document.createElement('LI');
    option.innerHTML = "--Select--";
    //option.value = "";
    option.setAttribute("value", "--Select--");
    ComboBoxCtrl._optionListControl.appendChild(option);
    continue;
}
var optn = document.createElement('LI');
optn.innerHTML = options[i];
//optn.value = options[i];
optn.setAttribute("value", options[i]);
ComboBoxCtrl._optionListControl.appendChild(optn);
}

Sys.Application.removeComponent(ComboBoxCtrl._popupBehavior);
ComboBoxCtrl.initializeOptionList();
ComboBoxCtrl.initializeButton();
ComboBoxCtrl._popupBehavior._visible = false;

Моя версия ajaxToolkitControl - 4.1.7.1213.

Когда я попытался отследить ошибку, я получил следующее сообщение

There is an error occurred: TypeError: Cannot read property 'style' of undefined
    at Sys.Extended.UI.ComboBox._highlightListItem (https://localhost/CombineScriptsHandler.ashx?_TSM_CombinedScripts_=True&v=WL_exbic68tpMKM8VhSeWzSZhMnOe7B7-INfrc8tfdg1&_TSM_Bundles_=&cdn=True:1:356098)
    at Sys.Extended.UI.ComboBox.initializeOptionList (https://localhost/CombineScriptsHandler.ashx?_TSM_CombinedScripts_=True&v=WL_exbic68tpMKM8VhSeWzSZhMnOe7B7-INfrc8tfdg1&_TSM_Bundles_=&cdn=True:1:346296)
    at InitializeComboBox (https://localhost/_layouts/Documentum/d2/D2PropertiesDialog.js:101:22)
    at Object.success (https://localhost/_layouts/Documentum/d2/D2PropertiesDialog.js:221:17)
    at c (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:4:26036)
    at Object.fireWith [as resolveWith] (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:4:26840)
    at k (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:6:14258)
    at r (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:6:18646)
    at Object.send (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:6:18771)
    at Function.ajax (https://localhost/_layouts/Documentum/jquery-1.10.2.min.js:6:13722)
...