Hello I have a treeview where I have added a integer Id as a hmtlattribute. This is a MVC4 Kendo UI project.
I am trying to access it from a button click event when a node is selected to pass foo to another view.
Here is the element from Chrome
How can I access this from the button click and send it in the Action?
branch.Add().Text("Item " + child).HtmlAttributes(new { data_foo = childs.MyId })I am trying to access it from a button click event when a node is selected to pass foo to another view.
$("#btn").click(function () { var treeview = $("#treeview").data("kendoTreeView"); var treeSelect = treeview.select(); var passId = treeSelect.attr("foo"); window.location = "@Url.Action("Index","Content")" + "?MyIntegerParameter=" + passId;*});Here is the element from Chrome
<li class="k-item" data-foo="30" data-uid="7f3430d0-4b01-4b08-b4be-1264d3ff16d3" role="treeitem" aria-selected="true" id="treeview_tv_active"> <div class="k-top"> <span class="k-in k-state-selected">This Is The Text</span> </div></li>How can I access this from the button click and send it in the Action?