Gitter chat

Kendo UI Core Components

This package (KUICC: Kendo UI Core Components) provides web component wrappers for Kendo UI Core widgets. All functionalities of Kendo UI Core except AngularJS are supported.

Important Note This package is NOT published by Progress Software Corporation, the owner of Kendo UI frameworks, and so no supports are provided from the company.

Features

Usage

Installations and Resource references

{version} in the snippet will be replaced by consistent version number from which vsc-kendo-core-components is built. Current version is __2018.3.911__.

### Naming conventions

* Tag names are dash-separated counterpart of official widget names prefixed by 'km-' for mobile widgets and 'k-' for others. 
e.g.
      AutoComplete    => k-auto-complete
      Dialog          => k-dialog
      MobileSplitView => km-split-view
      MobilePane      => km-pane ~~~

Approach1, however, handles individual widget, so all properties and methods(listeners) of configuration can be passed through element attributes. KUICC automatically calls the jquery plugin function $.fn.kendoWidgetName(options:WidgetNameOptions) for you. e.g. See a page demo below where even there are no js codes. Source codes in page

... ...
<body>
  <div id='example'>
    <div class='demo-section k-content'>
      <h4>Find a Customer</h4>
      <k-auto-complete id="customers"
                       data-text-field="ContactName"
                       data-source='{
                         type:"odata",
                         transport:{
                           read:"https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"},
                           group:{field:"Country"}
                          }'
                       heigth="400"
                       style="width:100%"></k-auto-complete>
      <div class="demo-hint">Hint: type "an"</div>
    </div>
  </div>
</body>
</html>

is transpiled to

  <input id='customers' style='width:100%' />

in page and initialization

  $('#customers').kendoAutoComplete({
    height: 400,
    dataTextField: 'ContactName',
    dataSource:{
      type: "odata",
      transport: {
          read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"},
          group: {field:"Country"}
      }
    }
  });

is executed automatically for you.

Attribute value assignments

As shown in above snippets, configuration of a Kendo widget is fulfiled in attributes of the component. Some attributes (e.g. id, style) belong to the html element a widget attached while others are properties of the configuration options object. For example, height, data-source, data-value-field, etc. are properties of kendo.ui.AutoCompleteOptions object. All values of configuration properties will be evaluated and then assigned to the properties. The evaluation carrys out in following order:

Widgets in templates

You can configurate Kendo widgets in templates in script or attribute value literals.

      <k-tool-bar items=items
                  ... ...
                  resizable=false></k-tool-bar>
      ... ...

  <script>
      var items = [
        { template: `<label>SHAPE:</label>
        <k-drop-down-list id='shape' 
                          data-text-field='text'
                          data-value-field='value'
                          data-source=dataShape 
                          change=onShapeChange></k-drop-down-list>` },
      ... ...
  </script>

Dynamical widgets

KUICC overrides $.fn.appendTo, $.fn.prependTo, $.fn.insertBefore, and $.fn.insertAfter, you can use them to create widgets dynamically. e.g. Listener below change a menu orientation by re-building it(see menu demos for details). (setOptions() seems not working)

      $(".options input").change(function () {
        $('#openAnimation').prop('hidden', !$('#open')[0].checked);
        $('#closeAnimation').prop('hidden', !$('#close')[0].checked);
        $('k-menu').remove();
        $(`<k-menu id="menu" 
                   data-source=data 
                   animation=getAnimation()></k-menu>`).appendTo(`#menuContainer`);
      });

Demos

In order to test validation of this package, I’ve rewritten most demos for Kendo UI Core (except AngularJS) from demos.telerik.com. You can clone the repository and run a http server (e.g. live-server) at the root directory and check the results in browsers.

Some tips

Change log

Change log

License

Apache License, version 2