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

Scheduler grouping and resources attributes declaratively

5 Answers 146 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 09 Jul 2014, 02:13 AM
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"
.....






5 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 10 Jul 2014, 11:57 AM
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!
 
0
Alex
Top achievements
Rank 1
answered on 10 Jul 2014, 12:12 PM
Perfect - thank you.
0
Alex
Top achievements
Rank 1
answered on 13 Jul 2014, 03:29 PM
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
}]"



0
Vladimir Iliev
Telerik team
answered on 14 Jul 2014, 09:05 AM
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!
 
0
Alex
Top achievements
Rank 1
answered on 14 Jul 2014, 01:27 PM
Thank you Vladimir it is really good to know that is the correct syntax .

Tags
Scheduler
Asked by
Alex
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Alex
Top achievements
Rank 1
Share this question
or