UI.Combo & UI.List: Add items to control - performance
See,
function LoadCountries()
{
/* AJAX request */
/* return array of objects */
countries = [{"id":"1", "name": "USA"},"id":"2", "name": "Canada"},..]
for (var i=0;i<countries.length; i++)
{
CountryComboBox.setItemText(countries[i].name, i);
}
CountryComboBox.setItemCount(countries.length);
}
If the number of items is big enough (say, above 1000), this code performs very slowly.
Can I add items to the "UI.Combo" (and "UI.List") any other way?
Thanks
function LoadCountries()
{
/* AJAX request */
/* return array of objects */
countries = [{"id":"1", "name": "USA"},"id":"2", "name": "Canada"},..]
for (var i=0;i<countries.length; i++)
{
CountryComboBox.setItemText(countries[i].name, i);
}
CountryComboBox.setItemCount(countries.length);
}
If the number of items is big enough (say, above 1000), this code performs very slowly.
Can I add items to the "UI.Combo" (and "UI.List") any other way?
Thanks
Michael
November 30,