I'm building a Kendo Scheduler using the MVVM methodology. I find that a lot of the configuration options, listed here: http://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler#methods-view, are difficult to achieve via the MVVM way. One of the things I'm attempting to achieve is change the scheduler view from week to month when a button is clicked. Yes, I know this support comes out of the box when a Kendo scheduler is initialized, but due to design and requirements, customization is needed. This is what I have:
HTML:
<
div
id
=
"scheduler-container"
>
<
div
class
=
"scheduler-toolbar"
>
<
div
class
=
"button-container"
data-bind
=
"events: { click: onClick }"
>
<
button
class
=
"btn btn-default view-btn"
value
=
"month"
>Month</
button
>
<
button
class
=
"btn btn-default view-btn"
value
=
"week"
>Week</
button
>
</
div
>
</
div
>
<
div
class
=
"scheduler"
data-role
=
"scheduler"
data-views
=
"['month', 'week']"
></
div
>
</
div
>
JS:
var
schedulerModel = kendo.observable({
onClick:
function
(e) {
/* change view here. is it possible? */
}
});
$(document).ready(
function
() {
kendo.bind($(
"#scheduler-container"
), schedulerModel);
});
Any help would be greatly appreciated! Thanks!