Fix: TomSelect addOption для загруженных групп
✅ this.addOption(item) для каждой группы из API ✅ Опции теперь доступны в this.options Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
964a0fd9e1
commit
df8172070a
|
|
@ -77,6 +77,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
.then(json => {
|
||||
// Фильтруем уже выбранные
|
||||
const filtered = json.filter(item => !selectedTags.has(String(item.id)));
|
||||
// Добавляем опции в TomSelect
|
||||
filtered.forEach(item => {
|
||||
this.addOption(item);
|
||||
});
|
||||
callback(filtered);
|
||||
}).catch(() => {
|
||||
callback();
|
||||
|
|
|
|||
Loading…
Reference in New Issue