updates
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user