I have a Telerikmvc treeview refresh question. I need to refresh the treeview after updating a partial view.
My javascript function to refresh the grid is –
var item = $("#TreeView").find(".t-input[name='itemValue'][value='" + Id + "']").closest("li");
$("#TreeView").data("tTreeView").ajaxRequest(item);
I get “no element found” javascript error.
Menu View –
@(Html.Telerik().TreeView()
.Name("TreeView")
.ShowLines(false)
.ClientEvents(events => events
.OnSelect("onSelect"))
.BindTo(Model, mappings =>
{
mappings.For<Model>(binding => binding
.ItemDataBound((item, products) =>
{
item.Text = products.Name;
item.Value = products.Id.ToString();
item.ImageUrl = "~/Content/Images/project_icon.jpg";
item.LoadOnDemand = true;
})
)
}
)
Thanks in advance.
I got it working.
I created a PartialView “Menu”. Controller code to return the partial view is
Jquery code to update a product and refresh the treeview –
}