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

Set scheduler resources dataSource after initialization

4 Answers 984 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
100%
Top achievements
Rank 1
100% asked on 05 Feb 2014, 12:41 PM
I want to initialize the scheduler in the beginning of my app (in the jquery ready handler) and when I get a list of something comparable to "owners" in

http://demos.telerik.com/kendo-ui/web/scheduler/index.html

I want to set the resources.dataSource member (the one with Alex, Bob and Charlie, but in my case, there are some other owners, data coming from an ajax response).

I tried to create an array of items all having the members text, value and color, and then

var scheduler = $("#wScheduler").data("kendoScheduler");
scheduler.resources[0].dataSource = theArray;
scheduler.dataSource.sync();

but that did not change the possible "owners" of scheduler tasks.

I have also tried

var ds = new kendo.data.SchedulerDataSource({data:items});
scheduler.resources[0].dataSource = ds;

and

var ds = new kendo.data.DataSource({data:items});
scheduler.resources[0].dataSource = ds;

with no luck.

4 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 07 Feb 2014, 08:41 AM
Hello,

Basically, you will need to add the data items using the data method of the data source and then just to re-render the widget. Here is a simple jsBin demo, which shows how to accomplish these tasks.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
100%
Top achievements
Rank 1
answered on 07 Feb 2014, 03:13 PM
Thanks a lot!
0
Siddhartha
Top achievements
Rank 1
answered on 18 Oct 2016, 12:50 PM

Hi,

I want to initialize the scheduler in the beginning like 

http://demos.telerik.com/kendo-ui/scheduler/timeline

it will also have two level of grouping but that will be dynamically fetched at runtime from ajex call.

also i have checked scheduler.resources[0].dataSource.add() method to add groupiong item,

but it adds only first group not the next group.

also second group data will be dependent on first group value like for Meeting Room 101 will have value A and B in second group and for Meeting Room 201 will have C and D .

how we can do this.

Thanks

Siddhartha

 

0
Georgi Krustev
Telerik team
answered on 20 Oct 2016, 08:06 AM
Hello Siddhartha,

In general, every group level uses a separate resource datasource. That being said, you will need to use resources[1] (second resource) to add items to the second group level.

Here is a demo that demonstrates how to dynamically update the resources while the widget is grouped:

http://dojo.telerik.com/@ggkrustev/icUNa

Regards,
Georgi Krustev
Telerik by Progress
 
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
 
Tags
Scheduler
Asked by
100%
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
100%
Top achievements
Rank 1
Siddhartha
Top achievements
Rank 1
Share this question
or