Declarative Bindings Uniform Implementation/Documentation

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    18 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2012 Link to this post

    We need uniform implementation and dedicated documentation similar to "Configuration" that describes how to declaratively bind controls.  I'm having to do a lot of repetitive coding for binding that should be a simple declarative structure.  You should be able to enable a property on your kendo framework and request it to declaratively data bind and off you go.  Very little coding necessary.  For example:

    <input id="siteList" class="ctrlDropDown" data-template="#siteListTemplate" data-dataurl="Layout/sites.json" data-selector="sites" /> 

        .each(function (index, htmlControl) {
            var control = $(htmlControl);
            var dataSourceUrl = control.attr("data-dataurl");
            var dataSourceCallback = control.attr("data-datacallback");
            var template = control.attr("data-template");
            var dataType = control.attr("data-type");
            var dataText = control.attr("data-text");
            var dataValue = control.attr("data-value");
            var dataSelector = control.attr("data-selector");
            var dataSource = new{
                type: (dataType != null) ? dataType : null,
                transport: {
                    read: {
                        url: dataSourceUrl,
                        jsonpCallback: (dataSourceCallback != null) ? dataSourceCallback : ""
            dataSource.fetch(function (data) {
                    autoBind: true,
                    dataTextField: dataText,
                    dataValueField: (dataValue != null) ? dataValue : dataText,
                    template: (template != null) ? kendo.template($(template).html()) : null,
                    dataSource: (dataSelector != null) ? eval("data.sender._pristine." + dataSelector) : data.sender._pristine
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 25 Jun 2012 Link to this post

    Hello Jeff,

     We have documented the declarative initialization in the "Fundamentals" help topic. You could also check this blog post: 

    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top