Skip to content

Instantly share code, notes, and snippets.

@Souldrinker
Forked from JeroenVinke/app.html
Last active April 26, 2017 08:02
Show Gist options
  • Select an option

  • Save Souldrinker/98f52ac511f5c688e1ce5791faeaf367 to your computer and use it in GitHub Desktop.

Select an option

Save Souldrinker/98f52ac511f5c688e1ce5791faeaf367 to your computer and use it in GitHub Desktop.
Aurelia KendoUI component - problem report
<template>
<require from="aurelia-kendoui-bridge/button/button"></require>
<button ak-button>This is a button</button>
<ak-scheduler view-model.ref="schedulerViewModel" k-widget.bind="scheduler" k-on-navigate.delegate="navigate($event.detail)"></ak-scheduler>
</template>
export class App {
navigate(event) {
if(event.action === "changeView"){
this.schedulerViewModel.destroy();
setTimeout(() => {
this.schedulerViewModel.recreate();
setTimeout(() => {
this.scheduler.view(event.view);
//this.refreshScheduler();
}, 0);
}, 0);
}
//..for all other actions (next/previous/today/changeDate)*/
this.scheduler.date(event.date);
}
}
<!doctype html>
<html>
<head>
<title>Aurelia KendoUI bridge</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2017.1.223/styles/kendo.mobile.all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2017.1.223/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2017.1.223/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2017.1.223/js/kendo.all.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.5.0/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge', kendo => kendo.pro());
aurelia.start().then(a => a.setRoot());
}

Add any additional information here

When switching view (between day/week) I always seem to get an error in the console on line 93672 in kendo.all.js:

return getDate(this._model.get('selectedDate'));

...seemingly due to this_model is null. Any idea why and what I can do to get rid of it would be appreciated.

Another issue that I noticed here that might be due to my own error(?) and behaves the same in both versions is that I can't seem to change view when the view is to narrow and the view buttons gets grouped to a dropdown. In that case the navigate event seem to be hit with a changeView action as soon as I click on the view selector. Without my own k-on-navigate overload the dropdown works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment