Hi:
I would like to share some success with panelbar and datasource.
I have created a class vwPanelItem to map to the data structure needed for the PanelBar, as follows (see panelbar overview):
This is delivered via a web-service as a json object as follows:
This is from a MVC implementation. Thus the @(ViewBag.RequestService) is dynamic string being handed to the view from the controller (it is the web-service method).
Good luck:
Phil
I would like to share some success with panelbar and datasource.
I have created a class vwPanelItem to map to the data structure needed for the PanelBar, as follows (see panelbar overview):
public class vwPanelItem{ public string value { get; set; } public string text { get; set; } public string content { get; set; }}This is delivered via a web-service as a json object as follows:
<ul id="kjContactsPanel"></ul><script type="text/javascript"> // var contactsDataSource = new kendo.data.DataSource({ transport: { read: { url: "/Services/Contacts.asmx/@(ViewBag.RequestService)", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8" }, }, schema: { data: "d" }, change: function () { var panelItems = this.view().toJSON(); var panelBar = $("#kjContactsPanel").kendoPanelBar({ dataSource: panelItems, expandMode: "single" }).data("kendoPanelBar"); } }); // contactsDataSource.read(); //</script>Good luck:
Phil