This is a migrated thread and some comments may be shown as answers.

[Solved] Clientside Load on Demand in Combobox

1 Answer 140 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brijendra Kumar
Top achievements
Rank 1
Brijendra Kumar asked on 10 Jul 2009, 12:46 PM
Hello Everyone,


I am in a problem. I have taken a rad combobox and i have to bind items in combobox.
Items are arround 2500. when i am binding this, a warning is coming "script on this page is causing internet explorer to run slowly".
and when i select an item from this combobox it was opening and closing dropdowns very slowly.
i am binding data using the following method:

 

for (var rowIndex = 0; rowIndex < table.rows.length; rowIndex++) {

 

 

var rows = table.rows[rowIndex];
comboItem = new Telerik.Web.UI.RadComboBoxItem();

 

comboItem.set_text(rows.crm_sug_country);

comboItem.set_value(rows.crm_sug_country);

countryControl.get_items().add(comboItem);
}

 

countryControl.commitChanges();



Does anyone knows what is the best way to bind items in combobox ?
I am holding these tables in javascript arrays. can we load items from this array on demand as like server side?

Please tell me ASAP....

I will be highly oblized to yours..>>>>>>>>>>>>>>>

Thanks & Regards
Brijendra pandey

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 10 Jul 2009, 02:21 PM
Hi Brijendra Kumar,

Since you have all the data at the client-side you could filter it when necessary and create Items 'on demand' similarly to the built-in Load on Demand mechanism.

For instance, you could handle the KeyPressing/DropDownOpening client-side event and filter the arrays extracting those Items which start with the text in the ComboBox and create Items only for them. Although this includes iterating through the large array it will be faster than the loop you are currently using.

Finally, is using a Web Service for Load on Demand an option for you?

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
ComboBox
Asked by
Brijendra Kumar
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or