Hello, i have a TreeView in my MVC application. When certain item is pressed, the div on page should change responding to the item ID. There is my code for that page (view):
@model List<Omnitel.Models.Directory>
@(Html.Kendo().TreeView()
.Name("Treeview")
.Events(events => events
.Select("onSelect")
)
.BindTo(Model, mapping =>
{
mapping.For<Omnitel.Models.Directory>(binding => binding
.ItemDataBound((item, category) =>
{
item.Id = category.Id;
item.Text = category.Title;
item.BindTo(category.SubDirectories, mapping2 =>
{
mapping2.For<Omnitel.Models.Directory>(binding2 => binding2
.ItemDataBound((item2, category2) =>
{
item2.Id = category2.Id;
item2.Text = category2.Title;
item2.BindTo(category2.SubDirectories, mapping3 =>
{
mapping3.For<Omnitel.Models.Directory>(binding3 => binding3
.ItemDataBound((item3, category3) =>
{
item3.Id = category3.Id;
item3.Text = category3.Title;
}
));
});
}
));
});
}
));
})
)
<script>
var treeview;
function onSelect(e) {
var url = @Url.Action("GetDocument", "TreeView", new { e.sourceNode.ID );
}
</script>
As u can see, i want to put put an Id in each item. Is it possible? and how? Need fast response...
@model List<Omnitel.Models.Directory>
@(Html.Kendo().TreeView()
.Name("Treeview")
.Events(events => events
.Select("onSelect")
)
.BindTo(Model, mapping =>
{
mapping.For<Omnitel.Models.Directory>(binding => binding
.ItemDataBound((item, category) =>
{
item.Id = category.Id;
item.Text = category.Title;
item.BindTo(category.SubDirectories, mapping2 =>
{
mapping2.For<Omnitel.Models.Directory>(binding2 => binding2
.ItemDataBound((item2, category2) =>
{
item2.Id = category2.Id;
item2.Text = category2.Title;
item2.BindTo(category2.SubDirectories, mapping3 =>
{
mapping3.For<Omnitel.Models.Directory>(binding3 => binding3
.ItemDataBound((item3, category3) =>
{
item3.Id = category3.Id;
item3.Text = category3.Title;
}
));
});
}
));
});
}
));
})
)
<script>
var treeview;
function onSelect(e) {
var url = @Url.Action("GetDocument", "TreeView", new { e.sourceNode.ID );
}
</script>
As u can see, i want to put put an Id in each item. Is it possible? and how? Need fast response...