Я пытаюсь удалить элемент из поля со списком Kendo UI в цикле for, но этот элемент не удаляется из поля со списком. Есть идеи, в чем может быть проблема?
Спасибо
Вот код, который я использую
if (!comboboxList) return;
const comboboxListLength = comboboxList.length;
for (let i = 0; i < comboboxListLength; i++) {
const comboBoxId = comboboxList;
const { CountryID: countryId, StateID: stateId } = comboBoxId.includes("CustomerOrd") ? CustomerOrderDetails?.CustomerInfo : CustomerOrderDetails?.SellerInfo;
const combobox = $(comboboxList).getKendoComboBox();
const ds = combobox.dataSource;
const comboboxData = ds.data().toJSON();
if (countryId !== 475 && stateId !== 475) {
const doesDefaultStillExistIdx = comboboxData.findIndex(f => f.DictionaryItemID == 475);
if (doesDefaultStillExistIdx !== -1) {
ds.remove(ds.at(doesDefaultStillExistIdx));
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... p-not-work