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