This question is locked. New answers and comments are not allowed.
Hi,
We are having problems with telerik Treeview load on demand when the treeview is loaded in a partial view. The problem happens in Firefox and Chrome but not IE. The parent list of nodes is correctly rendered but load on demand is not working for any children nodes. We are using Ajax databinding but when the '+' is clicked for any of the parent nodes, it is replaced by the busy icon (that does not dissapear) and the children nodes are never loaded. We have used exactly the same code outside of a partial view and it works without any problems. The treeview with load on demand inside a partial view seems to be the problem.
Here is the treeview control as defined in the partial view:
Note that we also had to explicity reference the treeview.min.js file at the top of the partial view:
The treeview would not render at all without this file included. Including it in the parent view did not help.
Here is the server ajax method with one TreeViewItem returned for testing purposes:
We have verified that the OnTreeViewRulesLoading method is being called using the visual studio debugger. We have also used firebug to verify that a correct JSON result is being returned.
We are using version 2010.3.1318 of the telerik MVC controls and jquery 1.4.4.
Any help would be appreciated
We are having problems with telerik Treeview load on demand when the treeview is loaded in a partial view. The problem happens in Firefox and Chrome but not IE. The parent list of nodes is correctly rendered but load on demand is not working for any children nodes. We are using Ajax databinding but when the '+' is clicked for any of the parent nodes, it is replaced by the busy icon (that does not dissapear) and the children nodes are never loaded. We have used exactly the same code outside of a partial view and it works without any problems. The treeview with load on demand inside a partial view seems to be the problem.
Here is the treeview control as defined in the partial view:
<%= Html.Telerik().TreeView() .Name("TreeViewRuleCategories") .BindTo(Model.RuleCategories, (item, RuleCategory) => { // bind initial data item.Text = RuleCategory.CategoryName; item.Value = RuleCategory.CategoryId.ToString(); item.LoadOnDemand = true; }).DataBinding(dataBinding => dataBinding.Ajax() .Enabled(true) .Select("OnTreeViewRulesLoading", "MappedRules") ).ClientEvents(events => events.OnSelect("OnRuleCategoryNodeSelected"))%>Note that we also had to explicity reference the treeview.min.js file at the top of the partial view:
<script src="/Scripts/2010.3.1318/telerik.treeview.min.js" type="text/javascript"></script>The treeview would not render at all without this file included. Including it in the parent view did not help.
Here is the server ajax method with one TreeViewItem returned for testing purposes:
[AcceptVerbs(HttpVerbs.Post)]public ActionResult OnTreeViewRulesLoading(TreeViewItem node){ List<TreeViewItem> nodes = new List<TreeViewItem>(); nodes.Add(new TreeViewItem() { Text = "Category", Value = "1", LoadOnDemand = true, Enabled = true }); return new JsonResult { Data = nodes };}We have verified that the OnTreeViewRulesLoading method is being called using the visual studio debugger. We have also used firebug to verify that a correct JSON result is being returned.
We are using version 2010.3.1318 of the telerik MVC controls and jquery 1.4.4.
Any help would be appreciated