This question is locked. New answers and comments are not allowed.
Hi All,
I'll try to make this brief.
I am using the JQuery UI Tabs plug-in to render the same partial view for all tabs. It uses Ajax to render the response from the action within the panel below the tabs.
The problem is not the rendering of the tree data, the problem is the client events. Only events for the first one rendered on the page get fired. Realize that the page DOM doesn't contain the data for the partial when the page is rendered. This is added via the JQuery UI Tabs, via AJAX. Then when the user clicks on another tab, another div is generated and another treeview is added.
All tabs render the partial view containing the treeview correctly. The problem is that the client events for all tabs except the first one, do not fire.
This is the markup for the treeview.... (this is in my partial view)
Thanks for any help you can give.
-Charles
I'll try to make this brief.
I am using the JQuery UI Tabs plug-in to render the same partial view for all tabs. It uses Ajax to render the response from the action within the panel below the tabs.
The problem is not the rendering of the tree data, the problem is the client events. Only events for the first one rendered on the page get fired. Realize that the page DOM doesn't contain the data for the partial when the page is rendered. This is added via the JQuery UI Tabs, via AJAX. Then when the user clicks on another tab, another div is generated and another treeview is added.
All tabs render the partial view containing the treeview correctly. The problem is that the client events for all tabs except the first one, do not fire.
This is the markup for the treeview.... (this is in my partial view)
Html.Telerik().TreeView() .Name("divCourseTreeView") .BindTo(Model.Tree, mappings => { // mapping for Course Root type mappings.For<CourseTreeItemRootViewModel>(binding => binding.ItemDataBound((item, root) => { item.Selected = true; item.Encoded = false; item.Expanded = true; item.Value = root.ID.ToString(); item.Text = Html.RenderCourseRootItem(root); }) .Children(root => root.Children)); // mapping for Folder type mappings.For<CourseTreeItemFolderViewModel>(binding => binding.ItemDataBound((item, folder) => { item.Encoded = false; item.Expanded = true; item.Value = folder.ID.ToString(); item.Text = Html.RenderCourseFolderItem(folder); }) .Children(folder => folder.Children)); // mapping for Activity type mappings.For<CourseTreeItemActivityViewModel>( binding => binding.ItemDataBound((item, content) => { item.Encoded = false; item.Text = Html.RenderCourseActivityItem(content); item.Value = content.ID.ToString(); })); }) .ExpandAll(true) .HtmlAttributes(new { @class = "jsDivCourseTree" }) .DragAndDrop(true) .ClientEvents(events => events .OnNodeDrop("Courses.NodeDrop") .OnSelect("Courses.NodeSelect") .OnLoad("Courses.TreeLoad") ) .Render();Thanks for any help you can give.
-Charles