Edit this page

Configure Text Binding

The example below demonstrates how to configure text binding for the Hybrid UI Button in Kendo UI.

Example
<div data-role="view" id="view" data-model="viewModel">
  <a data-role="button" data-bind="buttonText: value">Button</a>
</div>
<script>
   kendo.data.binders.widget.buttonText = kendo.data.Binder.extend({
    init: function(widget, bindings, options) {
      //call the base constructor
      kendo.data.Binder.fn.init.call(this, widget.element[0], bindings, options);
    },
    refresh: function() {
      var that = this,
          value = that.bindings["buttonText"].get(); //get the value from the View-Model
      $(that.element).text(value);
    }
  });
  var app = new kendo.mobile.Application(document.body);
</script>

<script>
  var viewModel = kendo.observable({
    value: "CustomValue"
  });
</script>

See Also

Other articles on the Hybrid UI Button:

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy