Created
November 6, 2013 19:55
-
-
Save brian-mann/7343058 to your computer and use it in GitHub Desktop.
Kendo mixin to automate closing of kendo elements on ui
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
| ## this is the mixin | |
| Concerns.Kendo = | |
| onBeforeClose: -> | |
| @destroyKendos() | |
| destroyKendos: -> | |
| for key, el of @ui | |
| widget = kendo.widgetInstance(el, kendo.ui) | |
| widget?.destroy?() | |
| ## this is the view consumer | |
| class View extends App.Views.ItemView | |
| template: "kendo" | |
| ui: | |
| foo: "#foo" | |
| input: "#not-kendo-input" | |
| autoComplete: "#autoComplete" | |
| dropDownList: "#dropDownList" | |
| onShow: -> | |
| @ui.autoComplete.kendoAutoComplete() | |
| @ui.dropDownList.kendoDropDownList() | |
| @include "Kendo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment