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

[Solved] TreeView inside TabStrip causing problems

3 Answers 97 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tx3
Top achievements
Rank 1
Tx3 asked on 22 Jun 2010, 06:26 PM

Hi!

I have a problem when using TreeView inside tab control. Content of the tab is loaded with LoadContentFrom method like this:

items.Add().Text("Module view").LoadContentFrom("ModuleView",   
Constants.ctrl_ProductVersion, new { id = Model.Id }); 

and here is my partial view that I try load:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ParameterTabViewModel>" %> 
 
<%= Html.Telerik().TreeView()  
.Name("ModuleViewTreeView")  
.BindTo(Model.ModuleRowsTreeView.Modules, mappings =>   
{  
    // module version level  
    mappings.For<ModuleParameterTreeViewModel.ModuleRoot>(binding => binding                                  
            .ItemDataBound((item, module) => 
            {  
                item.Selected = module.IsSelected;  
                item.Expanded = module.IsExpanded;                      
                item.Encoded = false;  
                item.Text = ModuleHelper.GetModuleVersionContent(Model, module, Request.Url.PathAndQuery);  
            })  
            .Children(module => module.ModuleParameters));  
    // parameter level  
    mappings.For<ModuleParameterTreeViewModel.ModuleParameterLeaf>(binding => binding  
            .ItemDataBound((item, moduleParameter) => 
            {  
                item.Selected = moduleParameter.IsSelected;  
                item.Encoded = false;  
                item.Text = ModuleHelper.GetModuleParameterContent(Model, moduleParameter, Request.Url.PathAndQuery);  
            }));  
})%> 
 
 

I get javascript errors from the beginning of the generated html file: Object doesn't support this property or method method. 

I have tried to add manually few JavaScript files that were suggested in other threads, but that didn't help. Everything runs smoohtly if I don't use LoadContentFrom and I use this instead:

            items.Add().Text("Module view")  
                 .Content(()=> 
                 {%> 
                    <% Html.RenderPartial("ModuleView"); %> 
                    <% if (Model.IsEditable)  
                       { %> 
                    <p>                              
                        <%= Html.ActionLink("Add new module version", "AddModuleVersion", "Module", new { id = Model.Id, source = (int)Model.Source, url = ParKone.UIHelpers.GridHelper.SetSelectedTabToCurrentUrl(ParameterTab.ModuleView) }, new { })%>         
                    </p> 
                    <% } %> 
                 <%}); 

Any suggestions?

-Tatu

 



3 Answers, 1 is accepted

Sort by
0
Tx3
Top achievements
Rank 1
answered on 23 Jun 2010, 07:22 AM
I was able to bypass the problem. I just removed LoadContentFrom method call from the initial tab, so other tabs are loaded "on-demand" and initial tab is loaded with Content. Maybe it was some kind of timing or initialization problem..
0
Georgi Krustev
Telerik team
answered on 23 Jun 2010, 08:42 AM
Hello Tatu,

Unfortunately it is hard to determine where exactly could be the cause of this erroneous behavior.

If the problem still appears, I will suggest you send us a simple test project which reproduce the depicted issue. Thus we will be able to investigate the problem locally and advice you further.

Regards,
Georgi Krustev
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
0
Richard
Top achievements
Rank 1
answered on 04 Nov 2010, 07:59 AM
 Hi.

ModuleView.ascx ' s generated html file

JQuery('#ModuleViewTreeView').tTreeView();  <-- here ...  Object doesn't support this property or method method.

solution:
before  call LoadContentFrom
need file -> telerik.treeview.js

 I'm sorry. I can't not english ^^;
Tags
TabStrip
Asked by
Tx3
Top achievements
Rank 1
Answers by
Tx3
Top achievements
Rank 1
Georgi Krustev
Telerik team
Richard
Top achievements
Rank 1
Share this question
or