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

Client-side: synchronously wait for items to load

2 Answers 224 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dili
Top achievements
Rank 1
Dili asked on 18 Sep 2014, 01:45 PM
Hi everyone,

I'm manipulating a RadComboBox client-side in javascript using jquery and need some help. I'm loading items into the dropdown via the requestItems() method. I would like to do a synchronous wait until the dropdown has finished loading completely. I couldn't find any such methods in the documentation: http://www.telerik.com/help/aspnet-ajax/combobox-client-side-radcombobox.html

Here's my code

var cb = $find('RadComboBoxId');
var filterText = "my filter";
 
cb.clearItems();
cb.clearSelection();
cb.showDropDown();
cb.set_text(filterText);
cb.requestItems(filterText, false);
/* i would like to wait synchronously here until the list has completely loaded
   before proceeding to the next line. */
alert('all relevant items have been loaded!');

Does anyone know of a solution? Solution doesn't have involve jquery.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 19 Sep 2014, 10:50 AM
Hi,

In such scenario we recommend using the OnClientItemsRequested event which  occurs after the load-on-demand mechanism has added new items to the RadComboBox.

Hope this information will be helpful.


Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dili
Top achievements
Rank 1
answered on 19 Sep 2014, 02:41 PM
Hi Plamen,

Thank you for your reply! I was hoping to avoid using an asynchronous event but it seems there's no other pattern available from telerik to achieve this. I'll try something out in the next few days and post my solution here.

Thanks again!
Tags
ComboBox
Asked by
Dili
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Dili
Top achievements
Rank 1
Share this question
or