This is a migrated thread and some comments may be shown as answers.
Setting MinorTickCount programmatically
6 Answers 116 Views
This is a migrated thread and some comments may be shown as answers.
EFS
Top achievements
Rank 1
EFS asked on 29 Jan 2015, 01:18 AM
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

6 Answers, 1 is accepted

Sort by
0
EFS
Top achievements
Rank 1
answered on 29 Jan 2015, 02:17 AM
Tried this as well, with no effect:
scheduler.views.week.minorTickCount=4;
scheduler.refresh();
0
Georgi Krustev
Telerik team
answered on 30 Jan 2015, 12:46 PM
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!
 
0
EFS
Top achievements
Rank 1
answered on 27 Feb 2015, 04:59 AM
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.
0
EFS
Top achievements
Rank 1
answered on 27 Feb 2015, 05:00 AM
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.
0
EFS
Top achievements
Rank 1
answered on 27 Feb 2015, 05:01 AM
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.
0
Rosen
Telerik team
answered on 03 Mar 2015, 07:16 AM
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!
 
Asked by
EFS
Top achievements
Rank 1
Answers by
EFS
Top achievements
Rank 1
Georgi Krustev
Telerik team
Rosen
Telerik team
Share this question
or