-
-
Save sylvain-hamel/a20374f622fdd89dd41cf34b1d2fe74d to your computer and use it in GitHub Desktop.
Menu: context menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./context-menu.css!css"></require> | |
<require from="aurelia-kendoui-bridge/listview/listview"></require> | |
<require from="aurelia-kendoui-bridge/dropdownlist/dropdownlist"></require> | |
<require from="aurelia-kendoui-bridge/contextmenu/contextmenu"></require> | |
<require from="aurelia-kendoui-bridge/common/template"></require> | |
<div id="example"> | |
<div class="demo-section k-content wide"> | |
<ak-list-view k-data-source.bind="dataSource" id="listview-context-menu"> | |
<ak-template> | |
<div class="product"> | |
<img src="http://demos.telerik.com/kendo-ui/content/shared/images/employees/${FromID}.png" alt="${From}" /> | |
<h3>${Title}</h3> | |
<p class="date">${Date}</p> | |
<p>${From}</p> | |
</div> | |
</ak-template> | |
</ak-list-view> | |
</div> | |
<ul id="menu" | |
ak-contextmenu="k-orientation.two-way: vertical; k-target: #listview-context-menu; k-filter: .product; k-animation.bind: animation" | |
ak-contextmenu.ref="contextVM"> | |
<li repeat.for="i of items"> | |
${i} | |
<ul> | |
<li repeat.for="j of ['a', 'b', 'c']">${j} | |
</li> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ContextMenu { | |
orientation = 'horizontal'; | |
dataSource = new kendo.data.DataSource({ | |
data: [{ | |
MailID: 1, | |
FromID: 1, | |
From: 'Ivo Nedkov', | |
Date: '2/22/2009', | |
Title: 'RE: New version of Telerik Trainer' | |
}, { | |
MailID: 2, | |
FromID: 2, | |
From: 'Jytte Petersen', | |
Date: '2/22/2009', | |
Title: 'RE: New version of Telerik Trainer' | |
}], | |
pageSize: 5 | |
}); | |
count = 3; | |
items = [1, 2, 3]; | |
constructor(){ | |
setInterval(()=>{ | |
this.items.push(++this.count); | |
setTimeout(()=>{ | |
this.contextVM.recreate(); | |
}); | |
}, 5000); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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/2016.2.714/styles/kendo.common.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css"> | |
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/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/2016.2.714/js/jquery.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script> | |
<script src="https://kendo.cdn.telerik.com/2016.2.714/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.0.0-beta.1.0.6/config2.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging() | |
.plugin('aurelia-kendoui-bridge'); | |
aurelia.start().then(a => a.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment