DropDownList event timing - event after selection is completely done

5 posts, 1 answers
  1. David
    David avatar
    5 posts
    Member since:
    Jan 2015

    Posted 03 Feb Link to this post

    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!

  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 08 Feb Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. David
    David avatar
    5 posts
    Member since:
    Jan 2015

    Posted 08 Feb in reply to Plamen Link to this post

    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!

  5. Answer
    Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 08 Feb Link to this post

    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
  6. David
    David avatar
    5 posts
    Member since:
    Jan 2015

    Posted 06 Apr in reply to Plamen Link to this post

    Thanks - this helped us sort it out.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready