JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › DropDownList › DropDownList takes long time to initialize › Reply To: DropDownList takes long time to initialize
July 13, 2020 at 7:27 am
#100904
Tr12
Member
I tried to set dropDown.dataSource
to an array of objects rather than creating new smart-list-items. This improves performance a bit (it only needs about 300 ms), but it’s still relatively slow.
let perfStart = performance.now();
let dropDown = new window.Smart.DropDownList();
let datas = [];
for (let i = 0; i < 120; i++)
datas.push({
label: "Item " + i,
value: i
});
dropDown.dataSource = datas;
document.body.appendChild(dropDown);
let time = performance.now() - perfStart;
alert("Time: " + Math.floor(time));