Item expanded event?

8 posts, 0 answers
  1. Morten
    Morten avatar
    5 posts
    Member since:
    Apr 2009

    Posted 16 Apr 2009 Link to this post

    Hi

    I'd like to execute some client-side code right after an item has expanded.

    How can I do that?

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Apr 2009 Link to this post

    Hello Morten,

    Attach the handler to OnClientItemExpand client side event. The OnClientItemExpand client-side event occurs after the user has expanded a panel item. Go through the following link for more information about client side events of RadPanelBar.
    Client-Side Events

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Morten
    Morten avatar
    5 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    Thank you for answering.

    I already tried this event but it fires before the group is fully expanded. The expanding process takes about 500ms depending on the number of child items. So I'd like to be notified after 500ms.
  5. Morten
    Morten avatar
    5 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    What I'm looking for is an OnClientItemExpanded event instead of the OnClientItemExpand.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Apr 2009 Link to this post

    Hello Morten,

    A suggestion would be to use the onClientItemClicked client event and check if the panelbar item is expanded as shown below:
    aspx:
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnClientItemClicked="ClientItemClicked"
         <Items> 
           ..... 
         </Items> 
    </telerik:RadPanelBar> 

    js:
     function ClientItemClicked(sender ,eventArgs) 
        {    
            var item = eventArgs.get_item();   
            if (item.get_expanded() == true)   
            {           
               alert('expanded'); 
               // code here   
            }  
        } 

    Thanks
    Princy.
  7. Morten
    Morten avatar
    5 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    Hello Princy

    Imagine this scenario:

    0ms: An item is clicked which causes the OnClientItemClicked and OnClientItemExpand events to fire at almost the same time.
    0-499ms: The item is expanding, great so far.
    500ms: The item is fully expanded (no event fires).

    I need the last event :)
  8. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 22 Jan 2010 Link to this post

    I'm also looking for a little more Client-Side Event handlers. This control should have OnClientItemExpanded & OnClientItemCollapsed.
    Both events should be callbacks for when the item is fully expanded/collapsed.

    Morten is correct as the OnClientItemExpand event fires right away after being clicked.

    My scenario is I have a single RadPanelBar on top of another div. When the PanelBar is "Expand-ed" I need an event to hook-into, in order to resize the contents of the div below.

    <pre> 
    ---------------- 
    | PanelBar  \/ | 
    ---------------- 
    |              | 
    |     Div      | 
    |              | 
    |              | 
    ---------------- 
    </pre> 


    Currently there is no way to accomplish such a scenario.
  9. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Jan 2010 Link to this post

    Hello there,

    You can still use OnClientItemExpand event execute your code in setTimeout method,  the second parameter should be set to the duration of the expanded animation of the panelbar.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017