The Demo here:
http://demos.kendoui.com/web/mvvm/widgets.html
Shows how to bind to a number of widgets in the Kendo UI library. But I haven't had luck with some others including the menu. I've tried to convert the example here:
http://demos.kendoui.com/web/menu/index.html
To use the MVVM framework in the most straighforward manner. To be sure the KendoUI library was properly referenced, I put the MVVM test together with the non-MVVM method show in the demo. The result is that only the non-MVVM method works. The MVVM menu does not render (it shows up empty - just a thin horizontal line). There are no runtime errors or exceptions thrown.
HTML:
<body>
<ul id="menu">
</ul>
<br />
<ul data-role="menu" data-bind="source: dataSource">
</ul>
</body>
JavaSript:$(document).ready(documentReady);
var viewModel = {
dataSource: [
{
text: "Menu Item 1",
items: [
{ text: "Sub Menu Item 1" },
{ text: "Sub Menu Item 2" }
]
},
{ text: "Menu Item 2" }
]};
function documentReady() {
$("#menu").kendoMenu(viewModel);
kendo.bind($("body"), kendo.observable(viewModel));
}
9 Answers, 1 is accepted
All the best,
Alex Gyoshev
the Telerik team
At this time, only the TreeView widget supports hierarchical binding, as shown in the binding to remote data example. This feature is not yet planned to be added for the Menu or PanelBar widgets.
Regards,Alex Gyoshev
Telerik
Any plans to add source binding to the menu widget?
Thanks.
In order to raise the priority of these items, vote on UserVoice (DataSource for Menu, DataSource for PanelBar). Once they gather enough votes, they will become planned and implemented in the next release.
Regards,Alex Gyoshev
Telerik