This question is locked. New answers and comments are not allowed.
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