Scheduler grouping and resources attributes declaratively

6 posts, 1 answers
  1. Alex
    Alex avatar
    25 posts
    Member since:
    Dec 2012

    Posted 08 Jul 2014 Link to this post

    Trying to see implement grouping and resources in scheduler widget, however am using declarative syntax for the widget construction and binding it to a view model.

    This is the widget :

            <div data-role="scheduler"
                 data-views="['day','week','month','agenda']"
                 data-height="500"
                 data-bind="source: plannerDS"
                 ></div>

    But to achieve the vertical grouping as in the demo:
    http://demos.telerik.com/kendo-ui/scheduler/resources-grouping-vertical

    is this the syntax  and also has anyone advice for the syntax for implementing the datasource for each resource field? :          

                 data-group-resources="Rooms"
                 data-group-orientation="vertical"
                 data-resources-field="roomID"
                 data-resources-name="Rooms"
    .....






  2. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 10 Jul 2014 Link to this post

    Hi Alex,

    Please check the example below about how to enable vertical grouping when the scheduler is initialized using MVVM:
    Regards,
    Vladimir Iliev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Alex
    Alex avatar
    25 posts
    Member since:
    Dec 2012

    Posted 10 Jul 2014 in reply to Vladimir Iliev Link to this post

    Perfect - thank you.
  4. Alex
    Alex avatar
    25 posts
    Member since:
    Dec 2012

    Posted 13 Jul 2014 in reply to Alex Link to this post

    I'm having trouble getting the correct syntax to bind the dataSource of  the data-resources  to a datasource defined  in  the viewmodel.   I've tried about 100 permutations but without success,  is it possible ? 

    this is not correct of course:

                 data-resources="[{
                                 field: 'ownerId',
                                 title: 'Owner',
                                 name: 'Owner',
                                 dataSource: myresourceDataSource
    }]"



  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 14 Jul 2014 Link to this post

    Hi Alex,

    It's not possible to use directly the "source" binding for the scheduler resources, however you can reference the needed property from the view model as follows (the ViewModel should be accessible in current scope):

    data-resources="[{
         field: 'ownerId',
         title: 'Owner',
         name: 'Owner',
         dataSource: viewModel.resourceDS}]"

    Also you can check the updated example here.

    Regards,
    Vladimir Iliev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Alex
    Alex avatar
    25 posts
    Member since:
    Dec 2012

    Posted 14 Jul 2014 in reply to Vladimir Iliev Link to this post

    Thank you Vladimir it is really good to know that is the correct syntax .

Back to Top