-
-
Save gist-master/858420aeb1e75d8be963882a48ba3147 to your computer and use it in GitHub Desktop.
Multiselect: customizing templates
This file contains 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="./customizing-templates.css!css"></require> | |
<require from="aurelia-kendoui-bridge/multiselect/multiselect"></require> | |
<require from="aurelia-kendoui-bridge/common/template"></require> | |
<div id="example" class="multiselect-custom-templates"> | |
<div class="demo-section wide k-content"> | |
<ak-multiselect k-placeholder="Select customers..." | |
k-data-text-field="ContactName" | |
k-data-value-field="CustomerID" | |
k-height.bind="400" | |
k-data-source.bind="dataSource" | |
k-value.bind="value" | |
id="multiselect-customizing-templates-customers"> | |
<ak-template for="headerTemplate"> | |
<div class="dropdown-header k-widget k-header"> | |
<span>Photo</span> | |
<span>Contact info</span> | |
</div> | |
</ak-template> | |
<ak-template for="itemTemplate"> | |
<span class="k-state-default" style="background-image: url('http://demos.telerik.com/kendo-ui/content/web/Customers/${CustomerID}.jpg')"></span> | |
<span class="k-state-default"> | |
<h3>${ContactName}</h3> | |
<p>${CompanyName}</p> | |
</span> | |
</ak-template> | |
<ak-template for="tagTemplate"> | |
<span class="selected-value" style="background-image: url('../content/web/Customers/${CustomerID}.jpg')"></span> | |
<span>${ContactName}</span> | |
</ak-template> | |
</ak-multiselect> | |
</div> | |
</div> | |
</template> |
This file contains 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 Grouping { | |
dataSource = { | |
transport: { | |
read: { | |
dataType: 'jsonp', | |
url: '//demos.telerik.com/kendo-ui/service/Customers' | |
} | |
} | |
} | |
} |
This file contains 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
#multiselect-customizing-templates-customers-list .dropdown-header { | |
border-width: 0 0 1px 0; | |
text-transform: uppercase; | |
} | |
#multiselect-customizing-templates-customers-list .dropdown-header > span { | |
display: inline-block; | |
padding: 10px; | |
} | |
#multiselect-customizing-templates-customers-list .dropdown-header > span:first-child { | |
width: 50px; | |
} | |
#multiselect-customizing-templates-customers-list .selected-value { | |
display: inline-block; | |
vertical-align: middle; | |
width: 18px; | |
height: 18px; | |
background-size: 100%; | |
margin-right: 5px; | |
border-radius: 50%; | |
} | |
#multiselect-customizing-templates-customers_listbox .k-item { | |
line-height: 1em; | |
min-width: 300px; | |
} | |
/* Material Theme padding adjustment*/ | |
#multiselect-customizing-templates-customers_listbox .k-material .k-item, | |
#multiselect-customizing-templates-customers_listbox .k-material .k-item.k-state-hover, | |
#multiselect-customizing-templates-customers_listbox .k-materialblack .k-item, | |
#multiselect-customizing-templates-customers_listbox .k-materialblack .k-item.k-state-hover { | |
padding-left: 5px; | |
border-left: 0; | |
} | |
#multiselect-customizing-templates-customers_listbox .k-item > span { | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
display: inline-block; | |
vertical-align: top; | |
margin: 20px 10px 10px 5px; | |
} | |
#multiselect-customizing-templates-customers_listbox .k-item > span:first-child { | |
-moz-box-shadow: inset 0 0 30px rgba(0,0,0,.3); | |
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,.3); | |
box-shadow: inset 0 0 30px rgba(0,0,0,.3); | |
margin: 10px; | |
width: 50px; | |
height: 50px; | |
border-radius: 50%; | |
background-size: 100%; | |
background-repeat: no-repeat; | |
} | |
#multiselect-customizing-templates-customers_listbox h3 { | |
font-size: 1.2em; | |
font-weight: normal; | |
margin: 0 0 1px 0; | |
padding: 0; | |
} | |
#multiselect-customizing-templates-customers_listbox p { | |
margin: 0; | |
padding: 0; | |
font-size: .8em; | |
} |
This file contains 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 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', kendo => kendo.pro()); | |
aurelia.start().then(a => a.setRoot()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment