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

Collapsing Panelbar on client side.

2 Answers 102 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Anly
Top achievements
Rank 1
Anly asked on 26 Feb 2013, 02:27 AM
Hi,
I have added a RadPanelBar in the master page of my web application. I want to collapse all the items on a certain page load only and so I thought of writing the code in client side page load, but my JS shows some error and is not working properly. Can anyone help me with the client side code?

Thanks,
Anly.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 26 Feb 2013, 06:47 AM
Hi Anly,

Try the following JavaScript in the particular content page where you want the RadPanelBar items to be appeared as collapsed on page load.

JavaScript:
<script type="text/javascript">
function pageLoad() {
    var panelbar = $find("<%= Master.FindControl("RadPanelBar1").ClientID %>");   
    for (var i = 0; i < panelbar.get_allItems().length; i++) {
        panelbar.get_allItems()[i].set_expanded(false);
    }
</script>

Thanks,
Princy.
0
Anly
Top achievements
Rank 1
answered on 26 Feb 2013, 01:36 PM
Thanks princy for your valuable time. This works fine.
Tags
PanelBar
Asked by
Anly
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Anly
Top achievements
Rank 1
Share this question
or