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

[Solved] PanelBar won't Expand

2 Answers 44 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jack
Top achievements
Rank 1
Jack asked on 27 Jan 2011, 02:47 AM

Can someone more knowledgeable about Telerik PanelBars take a look at my problem.  We're evaluating the Telerik ASP.NET MVC tools and running into a showstopper.  Thanks!

So when I try to implement the PanelBar as per installation isntructions on a brand new ASP.NET MVC2 website it works fine.  But, when I try and implement on my legacy site (which I converted to WAP/MVC2 a while ago) it doesn't work. 

On the legacy site,  the bars show correctly, but when the page loads, a javascript error appears and I cannot click on the panelbar.  The javascript error is: 

Line: 24
Char: 1
Error: Object Expected
Code: 0
URL: http://localhost:47002/FAQS/Main/ViewPanel

Line 24 looks like this:

jQuery(document).ready(function(){

The view source for the code is as follows:
-----------------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
 ViewPanel
</title><link type="text/css" href="/Content/2010.3.1318/telerik.common.min.css" rel="stylesheet"/>
<link type="text/css" href="/Content/2010.3.1318/telerik.vista.min.css" rel="stylesheet"/>
</head>
<body>
    <div>

<ul class="t-widget t-panelbar t-reset" id="PanelBar"><li class="t-item t-state-default"><a class="t-link t-header" href="#PanelBar-1">Item 1<span class="t-icon t-arrow-down t-panelbar-expand"></span></a><div class="t-content" id="PanelBar-1" style="display:none">
                            <p>Content</p>
                       </div></li><li class="t-item t-state-default"><span class="t-link t-header">Item 2<span class="t-icon t-arrow-down t-panelbar-expand"></span></span><ul class="t-group" style="display:none"><li class="t-item t-state-default"><span class="t-link">Sub Item 1</span></li><li class="t-item t-state-default"><span class="t-link">Sub Item 2</span></li><li class="t-item t-state-default"><span class="t-link">Sub Item 3</span></li></ul></li></ul>
   
    </div>
<script type="text/javascript" src="/Scripts/2010.3.1318/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.3.1318/telerik.common.min.js"></script>
<script type="text/javascript" src="/Scripts/2010.3.1318/telerik.panelbar.min.js"></script>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
jQuery('#PanelBar').tPanelBar({expandMode:1});});
//]]>
</script>
</body>
</html>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is the ViewPanel view page code:

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

 

 

<html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

 

head runat="server">

 

 

 

 

<title>ViewPanel</title>

 

 

 

 

<%= Html.Telerik().StyleSheetRegistrar()

 

.DefaultGroup(group => group.Add(

 

"telerik.common.css")

 

.Add(

 

"telerik.vista.css"))

 

%>

 

 

</head>

 

<

 

 

body>

 

 

 

 

<div>

 

 

 

 

<% Html.Telerik().PanelBar()

 

.Name(

 

"PanelBar")

 

.Items(items =>

{

items.Add().Text(

 

"Item 1")

 

.Content(() =>

{%>

 

 

<p>Content</p>

 

 

 

 

<% });

 

items.Add().Text(

 

"Item 2")

 

.Items(subItems =>

{

subItems.Add().Text(

 

"Sub Item 1");

 

subItems.Add().Text(

 

"Sub Item 2");

 

subItems.Add().Text(

 

"Sub Item 3");

 

});

})

.Render();

%>

 

 

 

</div>

 

 

 

 

<%= Html.Telerik().ScriptRegistrar() %>

 

 

 

</body>

 

</

 

 

html>

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Jack
Top achievements
Rank 1
answered on 27 Jan 2011, 10:31 PM
I'm working like hell to figure this problem out.  For whatever reason the code is getting commented out.  This is how it appears when you do a "view source" on the page that does not produce a working PanelBar:

//<![CDATA[
jQuery(document).ready(function(){
jQuery('#PanelBar').tPanelBar({expandMode:1});});
//]]>

Any ideas why this would be getting commented out?  Where can I find this in the code to fix it??

Is this a Telerik BUG?
0
Atanas Korchev
Telerik team
answered on 28 Jan 2011, 01:11 AM
Hi Jack, 

The code is not commented out - this is how it has been always output. I believe the problem is caused by something else because you said everything works as expected in a different project. Perhaps there is a configuration problem which needs to be addressed. I suspect that the required JavaScript files fail to load for some reason or that there is some JavaScript conflict which prohibits the panelbar from initializing properly. In order to provide further help we need you to answer the following questions:
  1. Do you use WebAsset combination? Does it work if you disable it?
  2. How is the panelbar configured? 
  3. Have you tried checking with Fiddler or Firebug for any failed HTTP requests? I failing request for a JavaScript file may lead to such problems.
  4. Can you attach a sample project showing the JavaScript error? Perhaps this is the best way to proceed. We will be able to troubleshoot the issue and get back with a solution.
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
PanelBar
Asked by
Jack
Top achievements
Rank 1
Answers by
Jack
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or