Setting MinorTickCount programmatically

7 posts, 0 answers
  1. EFS
    EFS avatar
    5 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 Link to this post

    Hello,

    The scenario is this - I have a dropdown representing time intervals - 5 , 10, 15, 20, 30 minutes, and a Scheduler where the MajorTick is set to 60 and MinorTickCount is set to 4.
    After the page is loaded, the scheduler renders with 4 times slots for each hour (15 mins for each each slot).

    I need to change at runtime the MinorTickCount of the scheduler in function of the dropdown value. Is that possible ?
    I have tried like shown below, but without success:

    var scheduler = $("#scheduler").data("kendoScheduler");
    scheduler.view("week");
    scheduler.minorTickCount=4;
    scheduler.refresh();

    Any advices ?

    Thanks
  2. EFS
    EFS avatar
    5 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 in reply to EFS Link to this post

    Tried this as well, with no effect:
    scheduler.views.week.minorTickCount=4;
    scheduler.refresh();
  3. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 30 Jan 2015 Link to this post

    Hello,

    If you would like to update the minor and major tick values dynamically, then you will need to set the new values using widget's setOptions method and then re-render the view using widget's view method. Check this Dojo demo for more details.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  4. EFS
    EFS avatar
    5 posts
    Member since:
    Jan 2015

    Posted 26 Feb 2015 in reply to Georgi Krustev Link to this post

    Hello Geogi.

    Unfortunately the provided Dojo demo isn't working fine for me. I was able to reproduce in it my own issue.

    Correct me if I'm wrong (which might be the case if I didn't correctly understand the way the scheduler works):
    1. Having a majorTick=60 an minorTick=30 should result in 2 time slot for the hour - from 00:00 to 00:30 and from 00:30 to 01:00 for each hour;
    2. Consequently if we change the minor tick to 15 we would have 4 time slots in each hour - for each quart of the hour.
    In the dojo example the initial majorTick and minorTicks are not set that gives us (I presume) a majorTick=60 and a minorTick=30 which gives us 2 time slots of 30 mins each. When you click the "Update options" button, the majorTick is set to 120 and the minorTick is set to 60 wich gives us again 2 time slots but of 60 minutes each.
    3. Now if the Dojo example we set majorTick to 240 and minorTick to 60, the events are stretching because fo the modified tick count (presumably 4).

    Here's what I think is not working : we are still seeing just one thin line between the thick lines representing the hours. I would expect 3 think lines, denoting 4 time slots.
  5. EFS
    EFS avatar
    5 posts
    Member since:
    Jan 2015

    Posted 26 Feb 2015 in reply to Georgi Krustev Link to this post

    Hello Geogi.

    Unfortunately the provided Dojo demo isn't working fine for me. I was able to reproduce in it my own issue.

    Correct me if I'm wrong (which might be the case if I didn't correctly understand the way the scheduler works):
    1. Having a majorTick=60 an minorTick=30 should result in 2 time slot for the hour - from 00:00 to 00:30 and from 00:30 to 01:00 for each hour;
    2. Consequently if we change the minor tick to 15 we would have 4 time slots in each hour - for each quart of the hour.
    In the dojo example the initial majorTick and minorTicks are not set that gives us (I presume) a majorTick=60 and a minorTick=30 which gives us 2 time slots of 30 mins each. When you click the "Update options" button, the majorTick is set to 120 and the minorTick is set to 60 wich gives us again 2 time slots but of 60 minutes each.
    3. Now if the Dojo example we set majorTick to 240 and minorTick to 60, the events are stretching because fo the modified tick count (presumably 4).

    Here's what I think is not working : we are still seeing just one thin line between the thick lines representing the hours. I would expect 3 think lines, denoting 4 time slots.
  6. EFS
    EFS avatar
    5 posts
    Member since:
    Jan 2015

    Posted 26 Feb 2015 in reply to Georgi Krustev Link to this post

    Hello Geogi.

    Unfortunately the provided Dojo demo isn't working fine for me. I was able to reproduce in it my own issue.

    Correct me if I'm wrong (which might be the case if I didn't correctly understand the way the scheduler works):
    1. Having a majorTick=60 an minorTick=30 should result in 2 time slot for the hour - from 00:00 to 00:30 and from 00:30 to 01:00 for each hour;
    2. Consequently if we change the minor tick to 15 we would have 4 time slots in each hour - for each quart of the hour.
    In the dojo example the initial majorTick and minorTicks are not set that gives us (I presume) a majorTick=60 and a minorTick=30 which gives us 2 time slots of 30 mins each. When you click the "Update options" button, the majorTick is set to 120 and the minorTick is set to 60 wich gives us again 2 time slots but of 60 minutes each.
    3. Now if the Dojo example we set majorTick to 240 and minorTick to 60, the events are stretching because fo the modified tick count (presumably 4).

    Here's what I think is not working : we are still seeing just one thin line between the thick lines representing the hours. I would expect 3 think lines, denoting 4 time slots.
  7. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 03 Mar 2015 Link to this post

    Hi,

    Actually, you will need to set minorTickCount, instead of minorTick (as there is not such option). My colleague  seems to have made a typo. Please excuse us for misleading you.

    Here you can find an updated demo.
     
    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top