OK it seems to me that this should be a simple thing but for some reason it is not documented anywhere (at least I can't find it).
Using:
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/menu/overview#bind-kendo-menu-to-a-hierarchical-model
I have a working menu EXCEPT hyper links
Sure I can get it to fire the select event. What exact is being passed in. I can't get the values I set on the "item" object (Text or Url).
What are the available properties for the "item" object in the above example?
All I need to do is make the select function redirect to a new page. I would think that this is what 99% of your users would want to do. Why is an end-to-end example of a hierarchical model with hyperlinks not given?
Please provide this.
@(Html.Kendo().Menu()
.Name("adminMenu") //The name of the menu is mandatory. It specifies the "id" attribute of the widget.
.BindTo(Model, mappings =>
{
mappings.For<McGladrey.DOTT.DataModel.DOTTCustom.sp_GetUserTreeData_Result>(binding => binding //define first level of menu
.ItemDataBound((item, parent) => //define mapping between menu item properties and the model properties
{
item.Text = parent.NodeName;
})
.Children(parent => parent.ChildrenNodes)
); //define which property of the model contains the children
mappings.For<McGladrey.DOTT.DataModel.DOTTCustom.sp_GetUserTreeData_Result>(binding => binding
.ItemDataBound((item, child) =>
{
item.Text = child.NodeName;
item.Url = child.NodeAction;
}));
})
.Events(e=>e.Select("MenuSelected"))
.Orientation(MenuOrientation.Vertical)
)
<script type="text/javascript">
function MenuSelected(e)
{
alert(e.item.Text + " " + e.item.Url);
}
</script>
-Martin
Using:
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/menu/overview#bind-kendo-menu-to-a-hierarchical-model
I have a working menu EXCEPT hyper links
Sure I can get it to fire the select event. What exact is being passed in. I can't get the values I set on the "item" object (Text or Url).
What are the available properties for the "item" object in the above example?
All I need to do is make the select function redirect to a new page. I would think that this is what 99% of your users would want to do. Why is an end-to-end example of a hierarchical model with hyperlinks not given?
Please provide this.
@(Html.Kendo().Menu()
.Name("adminMenu") //The name of the menu is mandatory. It specifies the "id" attribute of the widget.
.BindTo(Model, mappings =>
{
mappings.For<McGladrey.DOTT.DataModel.DOTTCustom.sp_GetUserTreeData_Result>(binding => binding //define first level of menu
.ItemDataBound((item, parent) => //define mapping between menu item properties and the model properties
{
item.Text = parent.NodeName;
})
.Children(parent => parent.ChildrenNodes)
); //define which property of the model contains the children
mappings.For<McGladrey.DOTT.DataModel.DOTTCustom.sp_GetUserTreeData_Result>(binding => binding
.ItemDataBound((item, child) =>
{
item.Text = child.NodeName;
item.Url = child.NodeAction;
}));
})
.Events(e=>e.Select("MenuSelected"))
.Orientation(MenuOrientation.Vertical)
)
<script type="text/javascript">
function MenuSelected(e)
{
alert(e.item.Text + " " + e.item.Url);
}
</script>
-Martin