This commit is contained in:
2025-12-02 02:06:05 +02:00
parent 2c998d7ba8
commit 718beee739
16 changed files with 21 additions and 61 deletions
+6 -16
View File
@@ -1,25 +1,15 @@
//import { Ut } from ".";
import { Ut } from ".";
export class AppendOptions {
constructor(target, data, opts) {
opts = opts || {};
if (opts.clear) {
this.dxHtml('');
}
if (typeof data === 'string') {
Object.entries(JSON.parse(data)).forEach(([k, v]) => target.append(new Option(v, k)));
}
else {
for (let id in data) {
target.append(new Option(data[id], id));
}
this.replaceChildren();
}
Ut.each(Ut.isStr(data) ? JSON.parse(data) : data, (val, id) => target.append(new Option(val, id)) );
}
}
// Ut.extendNodeUx(AppendOptions);
}