This is a migrated thread and some comments may be shown as answers.

Initiate PanelBar Content from DataSource

1 Answer 221 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Jesse
Top achievements
Rank 1
Jesse asked on 25 Jul 2014, 02:01 PM
I am using below code to populate the content of a panel bar. If I hard code source value to a json string, all works well. But, when I read the source value from a service, no luck. Please refer below for the relevant code.
Thanks for your time and help.


<script>
       $(document).ready(function() {
             var app = new kendo.mobile.Application(document.body);
            $("#viewtitle").html("Navi 4");

            var viewModel = kendo.observable({
                 invitations: new kendo.data.DataSource({
                  transport: {
                       read: {
                                  dataType: "json",
                                  url: "http://localhost:8080/NavXzy/rest/SecurityService/getNotifications?emailAddress=hd@bc.ca"
                                 }
                  }
             })
       });

           kendo.bind($("#invitationsDiv"), viewModel);
          $("#invitationsPanelBar").kendoPanelBar({});
   });
</script>

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 29 Jul 2014, 08:05 AM
Hi Jesse,

I am afraid that the PanelBar widget currently does not support binding to a DataSource object. In order to use a PanelBar with a remote data you would have to get the data before the widget is initialized. Here is a simple example illustrating how this could be done by using a DataSource and its requestEnd event handler.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
PanelBar
Asked by
Jesse
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or