Skip to content

Instantly share code, notes, and snippets.

@brian-mann
Created November 6, 2013 19:55
Show Gist options
  • Select an option

  • Save brian-mann/7343058 to your computer and use it in GitHub Desktop.

Select an option

Save brian-mann/7343058 to your computer and use it in GitHub Desktop.
Kendo mixin to automate closing of kendo elements on ui
## 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