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

Item expanded event?

7 Answers 152 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Morten asked on 16 Apr 2009, 03:06 PM
Hi

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

How can I do that?

 

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Apr 2009, 04:27 AM
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.
0
Morten
Top achievements
Rank 1
answered on 17 Apr 2009, 06:44 AM
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.
0
Morten
Top achievements
Rank 1
answered on 17 Apr 2009, 06:48 AM
What I'm looking for is an OnClientItemExpanded event instead of the OnClientItemExpand.
0
Princy
Top achievements
Rank 2
answered on 17 Apr 2009, 09:00 AM
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.
0
Morten
Top achievements
Rank 1
answered on 17 Apr 2009, 09:43 AM
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 :)
0
DGDev
Top achievements
Rank 2
answered on 22 Jan 2010, 08:21 PM
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.
0
Yana
Telerik team
answered on 26 Jan 2010, 01:16 PM
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.
Tags
PanelBar
Asked by
Morten
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Morten
Top achievements
Rank 1
DGDev
Top achievements
Rank 2
Yana
Telerik team
Share this question
or