KendoUI menu adding children
I'm trying to load the menu from the controller but the children element
are not shown...what am I doing wrong?
me view is
@(Html.Kendo().Menu().Name("menu").BindTo(Model, mappings =>
{
mappings.For<IDEA20.DO.Common.MenuItem>(binding =>
{
binding.ItemDataBound((item, category) => //define mapping
between menu item properties and the model properties
{
item.Text = category.Text;
}).Children(category => category.SubMenu);
});
})
)
The data are present in the controller and the model is defined as
public class MenuItem
{
public MenuItem()
{
SubMenu = new List<MenuItem>();
}
public string Text { get; set; }
public string Controller { get; set; }
public string Action { get; set; }
public bool Selected { get; set; }
public List<MenuItem> SubMenu { get; private set; }
}
I've seen the sample on kendo ui docs but It's referring to a
product/category with relation.. in my case the children are of the same
type....
Thanks
No comments:
Post a Comment