Initiate PanelBar Content from DataSource

2 posts, 1 answers
  1. Jesse
    Jesse avatar
    14 posts
    Member since:
    Jul 2014

    Posted 25 Jul 2014 Link to this post

    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>
  2. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 29 Jul 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top