Hi,
I have a radpanelbar with PersistStateInCookie="True". It's is populated dynamically in code behind. I want to write a javascript code to check if there is no level 0 item expanded then it expands the last level 0 item. I have written the following code:
It works fine in Firefox but in IE the panelBar object is always null.
Is this the best way to do the trick?
Can you please help me?
I have a radpanelbar with PersistStateInCookie="True". It's is populated dynamically in code behind. I want to write a javascript code to check if there is no level 0 item expanded then it expands the last level 0 item. I have written the following code:
function
ExpandFirst() {
var
panelBar = $find(
"<%= _radpnlbarMenu.ClientID %>"
);
if
(panelBar) {
var
item = panelBar.get_expandedItem();
if
(panelBar.get_expandedItem() ==
null
) {
var
items = panelBar.get_items();
if
(items.get_count() > 0)
items.getItem(items.get_count() - 1).expand();
}
}
}
$(document).ready(
function
() {
ExpandFirst();
});
<
telerik:RadPanelBar
OnItemDataBound
=
"RadpnlbarMenuOnItemDataBound"
runat
=
"server"
ID
=
"_radpnlbarMenu"
ExpandAnimation-Type
=
"InQuart"
ExpandAnimation-Duration
=
"500"
CollapseAnimation-Duration
=
"500"
CollapseAnimation-Type
=
"InQuart"
Height
=
"250px"
ExpandMode
=
"FullExpandedItem"
PersistStateInCookie
=
"True"
>
<
DataBindings
>
<
telerik:RadPanelItemBinding
Depth
=
"0"
Expanded
=
"true"
/>
</
DataBindings
>
</
telerik:RadPanelBar
>
It works fine in Firefox but in IE the panelBar object is always null.
Is this the best way to do the trick?
Can you please help me?