KendoUI Bridge Documentation
  • Introduction
  • About this application
    • Introduction
    • Navigation guide
    • Components catalog
    • Installation
    • Catalog index
    • Themes selector
  • About Aurelia
    • Key features
  • About KendoUI
    • Integrated with Aurelia
    • Why choose KendoUI
  • Developers tutorials
    • Introduction
    • Sample application structure
    • esnext - kendo
    • esnext-aspnetcore - kendo-2017
    • esnext-aspnetcore - kendo-2015
    • typescript - kendo
    • typescript-aspnetcore - kendo
    • esnext- webpack
    • typescript-webpack kendo
  • Developers notes
    • Current limitations
    • Loading a subset of controls
    • Lazy loading wrappers
    • Running gists
    • Kendo Tooltip HTML content
    • Bundling details
    • Dynamic content creation
    • Bundling step by step instructions
    • What you need to know
    • Localization
    • Prevent JSPM from loading jQuery
  • Bridge developers notes
    • Introduction
    • Bridge utilities
    • Generation of bindables
    • Babel DTS generator
    • Grid HTML api
    • Template compilation
    • Harvesting bindable variables
    • Registry helper class
    • Creating gists for the catalog app
  • Troubleshooting
    • Introduction
    • Using gists and GistRun
Powered by GitBook
On this page
  • 6.7 Harvesting bindable variables
  • 8.1 Properties from the options object inside each Kendo control
  • 8.2 Properties from the typescript definitions
  • Merge
  1. Bridge developers notes

Harvesting bindable variables

PreviousTemplate compilationNextRegistry helper class

Last updated 7 years ago

Bridge developers notes

6.7 Harvesting bindable variables

In order to reduce the amount of code we have to write per wrapper, we use the @generateBindables decorator introduced in the note. This decorator generates @bindable properties based on a list of strings, which is actually a list of properties that each Kendo control supports. So we need to maintain a list of possible properties per Kendo control.

image

We currently use two different techniques to "harvest" possible properties so they can be generated using the @generateBindables decorator.

  1. properties from the options object inside each Kendo control

  2. properties from the typescript definitions

In order to get the most accurate list of supported properties possible, we combine these two lists of properties into a single list. We pass this list to the @generateBindables decorator, which generates @bindable properties for us in a wrapper.

8.1 Properties from the options object inside each Kendo control

The first list of possible properties for a Kendo control is retrieved from the options object which is inside every Kendo control. It is possible to get to this object by running jQuery.fn["kendoChart"].widget.prototype.options. Note that the name of any Kendo control can be used here, but kendoChart is used to display the output. This statement returns us the following object:

This object contains both keys (autoBind, categoryAxis) and values (true, "chart"). We only care about the keys of this object, which gives us a list of properties that the Kendo control allows. However, this list is not always complete, so we need to augment this list with some other source.

8.2 Properties from the typescript definitions

Telerik maintains

which contains interface definitions, that in turn contains a list of available properties for a control:

Merge

At this point we have two lists of available properties for a Kendo control, one extracted from the options object inside each Kendo control, and one from the Kendo typescript definitions. We merge these two lists together into one list that is most accurate. This list gets passed onto the @generateBindables decorator which creates bindable properties based on this list.

image

image
typescript definitions
Generation of bindable properties