This is a migrated thread and some comments may be shown as answers.
Menu ..OnClientItemClicking not firing from within RadPanelItem within radPanelBar within Splitter
1 Answer 58 Views
This is a migrated thread and some comments may be shown as answers.
Neal
Top achievements
Rank 1
Neal asked on 26 Sep 2009, 01:09 PM
Hi All.

major hassle her,.. this ran nicely under the 2006.4 controls, but multiple errors and issues now.
I have bolded anditalicised them.

I have tried the demos and and and but to no avail.

Essentially:
1)  I have a menu within a Expanding/collapsing PanelBar which itself is in a Radpane within a Radsplitter. ie similar to Outlook left pane and Right Content pane.
The menu is databound, post a login, and depending on User Role different data / menu items re loaded.
Notably Either Admin or Broker (Wildlife insurance app).

If I try the menu's  OnClientItemClicking , this event does not fire.
I try this 

var

 

splitter = window["<%= RadSplitter2.ClientID %>"]; 

 

var

 

pane = splitter.GetPaneById("ContentPane");

 

pane.SetContentUrl(url);

 

var url = eventArgs.Item.NavigateUrl;

I've tried wrapping it in RadCodeBlock because of the server var as well....No Go.

This script error this leads to another error, in my pageload event i call a function which checks a server var for whether the user has validly logged in else it pops up a RadWindow Login.
This now will only fire if I Ctl-F5 - refresh the page, but not on initial load.

I tried substituting the above script with, the one as used in your demo for this,
i.e.

 

var

 

splitter = $find("RadSplitter2");
but the event will not fire anyway,..s0  whether i put the Script in the head, the top of the body , the bottom of it, whather I try wrapping the whole body content in a rad ajax pane,..nothing.

and if I click on the menu item,...the page I want in my content pane, loads in a new window!

Oh and of course the Radpane, panel bar, resize themselves to a few millimetres in width after the menu items are loaded from Db,..once actually logged in.
I am Currently using V 2009.1

Code behind is minor, just databinding and

 

 

protected void RadMenu1_OnItemDataBound(object sender, RadMenuEventArgs e)

 

{

 

RadMenuItem ei = e.Item as RadMenuItem;

 

ei.Target =

"ContentPane";

 

}

 

And ..of course I have deadlines for my clients and fees being Tuesday.  "Sweating!!"

the markup is included beneath: 
Many Thanks
Neal

 

<%

@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

 

 

 

 

 

Namespace="System.Web.UI" TagPrefix="asp" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">

 

<

 

html>

 

 

 

 

 

<head id="Head1" runat="server">

 

 

 

 

 

<link rel="stylesheet" type="text/css" href="~/RootStyle.css"/>

 

 

 

 

 

</head>

 

 

 

 

 

 

<body topmargin=10 leftmargin=0 onload="CheckCloseRefresh()" scroll="yes">

 

 

 

 

 

<form id="form1" runat="server" method="post" >

 

 

 

 

 

 

<asp:scriptmanager ID="Scriptmanager2" runat="server"></asp:scriptmanager>

 

 

 

 

 

 

 

<script language="javascript" type="text/javascript">

 

 

 

 

 

 

function CheckCloseRefresh()

 

{

 

var ShowLogin = <%= Show %>;

 

 

 

if (ShowLogin == true)

 

{

Login();

}

}

 

 

function Login()

 

{

 

var urlExtn = "ms=" + new Date().getTime();

 

 

var oWnd = radopen("Forms/Auth/Login.aspx?" + urlExtn , "Login");

 

}

 

 

function Menu_OnClientItemClicked(sender, eventArgs)

 

{

alert(

"menu clicked");

 

 

var splitter = $find("RadSplitter2");

 

 

var pane = splitter.GetPaneById("ContentPane");

 

pane.SetContentUrl(url);

 

var url = eventArgs.Item.NavigateUrl;

 

}

 

 

</script>

 

 

 

 

 

 

 

<telerik:RadWindowManager

 

 

ID="RadWindowManager1"

 

 

 

 

 

runat="server"

 

 

 

 

 

>

 

 

 

 

 

 

<Windows>

 

 

 

 

 

<telerik:RadWindow

 

 

ID="Login"

 

 

runat="server"

 

 

 

 

 

Width="600px"

 

 

 

 

 

Height="245px"

 

 

 

 

 

Modal="true"

 

 

 

 

 

Top="250"

 

 

 

 

 

Left="400"

 

 

 

 

 

BackColor="lightgray"

 

 

 

 

 

>

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

 

 

 

 

<!-- Div obox(GradientBackGround) -->

 

 

 

 

 

<div id="oBox"

 

 

 

 

 

class="oBox"

 

 

 

 

 

>

 

 

 

 

 

 

<!-- Div Top Center Text -->

 

 

 

 

 

<div id="DivTopText"

 

 

align="center"

 

 

class="DivTopText"

 

 

 

 

 

style="font-family:Lucida Calligraphy; font-size:large; color:Gold" >

 

Equine & Wildlife Insurance

 

</div>

 

 

</div>

 

 

 

<div id="UserInfo" align="right" style="width:100%; left:0;">

 

 

 

 

 

 

</div>

 

 

 

 

 

 

<div id="Main" style="position:absolute; top:70px; left:0px; width:100%; ">

 

 

 

 

 

<asp:Label ID="lblInfo" runat="server" Enabled="false"

 

 

text="Press the 'F11' key on your keyboard to run in Fullscreen"></asp:Label>

 

 

 

 

 

<telerik:radsplitter id="RadSplitter1" runat="server"

 

 

Height ="900px" width="100%"

 

 

Skin="Telerik"

 

 

liveresize="true"

 

 

orientation="Vertical"

 

 

 

 

 

BorderColor="Transparent"

 

 

 

 

 

BorderSize="1"

 

 

 

 

 

BorderStyle="None" BackColor="Transparent">

 

 

 

 

 

 

<telerik:radpane

 

 

Height="97%"

 

 

 

 

 

id="navigationPane" runat="server"

 

 

 

MaxWidth="300"

 

 

MinHeight="500"

 

 

MinWidth="75" Width="15%"

 

 

 

 

 

BackColor="DimGray">

 

 

 

 

 

 

<telerik:RadPanelbar ID="RadPanelbar1" runat="server"

 

 

Width="100%" PersistStateInCookie="True" >

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadPanelItem Text="Admin" Height="50%" Width="100%"

 

 

Expanded="True" runat="server" CssClass="FrmHdrMnuGrdnt">

 

 

 

 

 

<Items >

 

 

 

 

 

<telerik:RadPanelItem runat="server" Selected="True"

 

 

CssClass="FrmHdrMnuGrdnt" Width="100%">

 

 

 

 

 

<ItemTemplate >

 

 

 

 

 

<telerik:RadMenu ID="RadMenu1"

 

 

runat="server"

 

 

Flow="Vertical" Width="100%" Height="100%"

 

 

 

 

 

skin="Equistar"

 

 

 

 

 

EnableEmbeddedSkins="false"

 

 

 

 

 

DataFieldID="ScreenId"

 

 

DataFieldParentID="ParentScreenId"

 

 

 

DataNavigateUrlField="Screen"

 

 

DataTextField="Title"

 

 

DataValueField="ScreenId"

 

 

OnItemDataBound="RadMenu1_OnItemDataBound"

 

 

OnClientItemClicking="Menu_OnClientItemClicked"

 

 

 

 

 

>

 

 

 

</telerik:RadMenu>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

 

<telerik:RadPanelItem Text="Brokers" Expanded="True"

 

 

Height="50%" runat="server" CssClass="FrmHdrMnuGrdnt">

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadPanelItem runat="server">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<telerik:RadMenu ID="Radmenu2" runat="server"

 

 

 

Flow="Vertical" Width="99%" Height="99%"

 

 

 

 

 

skin="Equistar"

 

 

 

 

 

EnableEmbeddedSkins="false"

 

 

 

 

 

DataFieldID="ScreenId"

 

 

DataFieldParentID="ParentScreenId"

 

 

DataNavigateUrlField="Screen"

 

 

DataTextField="Title"

 

 

DataValueField="ScreenId"

 

 

OnItemDataBound="RadMenu2_OnItemDataBound"

 

 

OnClientItemClicking="Menu_OnClientItemClicked">

 

 

 

 

 

</telerik:RadMenu>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelItem>

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadPanelbar>

 

 

 

 

 

</telerik:RadPane>

 

 

 

 

 

 

<telerik:radsplitbar id="RadSplitbar1" runat="server"

 

 

CollapseMode="Both"

 

 

 

 

 

EnableResize="True"

 

 

EnableTheming="False"

 

 

ResizeStep="1"

 

 

 

 

 

 

BorderColor="BlanchedAlmond"

 

 

 

 

 

BorderStyle="solid"

 

 

 

 

 

BorderWidth="1px"

 

 

 

 

 

Width="10px">

 

 

 

 

 

</telerik:radsplitbar>

 

 

 

 

 

 

<telerik:radpane id="RadPane2" runat="server"

 

 

BackColor="White"

 

 

height="97%"

 

 

Width="100%"

 

 

 

 

 

 

> <!--

 

Nester Horizontal splitter

-->

 

 

 

 

<telerik:radsplitter id="RadSplitter2" runat="server"

 

 

liveresize="true"

 

 

orientation="Horizontal"

 

 

Skin="Telerik" Height="99%" Width="100%">

 

 

 

 

 

 

<telerik:radpane id="ContentPane"

 

 

runat="server"

 

 

 

 

 

height="99%"

 

 

width="99%"

 

 

 

 

 

MinHeight="250"

 

 

ContentUrl="EquistarMain.aspx"

 

 

 

 

 

MinWidth="500"

 

 

 

>

 

 

 

 

 

</telerik:radpane>

 

 

 

 

 

 

</telerik:radsplitter>

 

 

 

 

 

 

</telerik:radpane>

 

 

 

 

 

</telerik:radsplitter>

 

 

 

 

 

</div>

 

 

 

 

 

</form>

 

 

 

 

 

</body>

 

</

 

html>

 

 

 

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 29 Sep 2009, 07:03 AM
Hi Neal,

In general, your function should look something like that:

function OnClientItemClicking(sender, eventArgs) 
    alert("menu clicked"); 
    var splitter = $find('<%= RadSplitter2.ClientID %>'); 
    var pane = splitter.GetPaneById("ContentPane"); 
    pane.SetContentUrl(url); 
    var url = eventArgs.Item.NavigateUrl; 

For additional information on the matter please refer to the control's documentation.

Regards,
Paul
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.
Asked by
Neal
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or