In leaf click controller is called which shows cart. In this case all nodes in treeview are closed. How to force treeview to keep clicked leaf open after cart is displayed ?
public ActionResult FileBrowserData(string root)
{
var nodes = db.ExecuteQuery<TreeViewNode>(...
foreach (var n in nodes)
{
if (n.hasChildren)
continue;
n.text = "<a href='" + Url.Action("Browse", "Store", new { artomlii = n.id }) +
"'>" + n.text + "</a>";
}
return Json(nodes.ToArray(), JsonRequestBehavior.AllowGet);
}
kobruleht
Member
589 Points
463 Posts
Re: Implementing three level product catalog in shopping cart
Mar 01, 2011 05:37 PM|LINK
I implemented async loading treeview as described in
http://tpeczek.blogspot.com/2010/01/asynchronous-treeview-in-aspnet-mvc.html
<script type="text/javascript">
$(document).ready(function () {
$('#categories').treeview({
url: '<%= ResolveUrl("~/Store/FileBrowserData/")%>',
collapsed: true,
persist: "cookie"
});
});
</script>
In leaf click controller is called which shows cart. In this case all nodes in treeview are closed. How to force treeview to keep clicked leaf open after cart is displayed ?
public ActionResult FileBrowserData(string root) { var nodes = db.ExecuteQuery<TreeViewNode>(... foreach (var n in nodes) { if (n.hasChildren) continue; n.text = "<a href='" + Url.Action("Browse", "Store", new { artomlii = n.id }) + "'>" + n.text + "</a>"; } return Json(nodes.ToArray(), JsonRequestBehavior.AllowGet); }