Set scheduler resources dataSource after initialization

5 posts, 1 answers
  1. 100%
    100% avatar
    75 posts
    Member since:
    Apr 2013

    Posted 05 Feb 2014 Link to this post

    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.
  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 07 Feb 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. 100%
    100% avatar
    75 posts
    Member since:
    Apr 2013

    Posted 07 Feb 2014 in reply to Georgi Krustev Link to this post

    Thanks a lot!
  5. Siddhartha
    Siddhartha avatar
    7 posts
    Member since:
    Oct 2016

    Posted 18 Oct Link to this post

    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

     

  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 20 Oct Link to this post

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