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

DropDownList event timing - event after selection is completely done

4 Answers 252 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 03 Feb 2016, 05:41 PM

Hi, 

I'm trying to use a DropDownList event to trigger a complex page update (updating a bunch of divs, DataSource reads, etc), and cannot find an event that happens at the right *time* to get the behavior I want.  I want to call a javascript function AFTER the user has selected an item from the dropdownlist, AND the DropDownList has refreshed with the user's selection.  All the events listed here (http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#events) fire BEFORE the widget completes updating.  The reason I want to do this is to show a "Loading...." message, while the complex page update takes place (it is very complex and takes a couple of seconds), then hide "Loading" and show the new stuff.

Are there any other events I could use to trigger my activity?  Executing my update function via an event handler for any of the documented events resulting in the following sequence:

-drop down list expands

-user picks an item

-the page sitting for a couple of seconds while my update happens, with the list still expanded

-drop down list retracts and the page finishes nicely ....

 

I need an event that fires AFTER the DropDownList finishes updating.

 

bootstrap has such an event, as shown here: 

http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_dropdown_events&stacked=h

the hidden.bs.dropdown event is what I want.

Is there a generic Kendo equivalent, or workaround?  The control doesn't have to be a drop down list, its just that was simplest - there are very few items in it.  I would prefer to stick with a simple Kendo control, but if there isn't an appropriate event I'll use something else or a workaround -

Thanks!

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 Feb 2016, 06:37 AM
Hello,

Thank you for getting in touch with us.

One possible solution for such scenario is to use the close event only when change is made immediately before it. You can refer to this dojo page where a similar scenario is implemented by using a flag.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 08 Feb 2016, 11:03 PM

Thanks for the response, but your sample uses the same event already documented, and adapting your example exactly provides behavior that is no different from other attempts I've made.

The problem is that the event fires BEFORE the dropdownlist updates, retracts the list, and shows the new value.  It fires my long-lasting event, so the user is stuck looking at the opened DropDownList for 2-3 seconds.  I'll do something else.

 

Thanks!

0
Accepted
Plamen
Telerik team
answered on 09 Feb 2016, 05:44 AM
Hello,

Yes indeed it seems that there is such event inbuild in the control. One possible solution is to use the setTimeout and trigger your update after some time has passed.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 06 Apr 2016, 10:50 PM
Thanks - this helped us sort it out.
Tags
DropDownList
Asked by
David
Top achievements
Rank 1
Answers by
Plamen
Telerik team
David
Top achievements
Rank 1
Share this question
or