Edit this page

bindings Object

Represents all bindings applied to the current HTML element. Gets or sets the current view-model field value.

Example - getting the view model field

<div data-bind="slide: slideChecked" style="background: orange; width: 100px; height: 100px"></div>
<label>Check to slide<input type="checkbox" data-bind="checked: slideChecked"></label>
<script>
kendo.data.binders.slide = kendo.data.Binder.extend({
    refresh: function() {
        // Get the value of the view-model field to which the slide binding is bound (slideChecked)
        var value = this.bindings["slide"].get();

        if (value) {
            $(this.element).slideDown();
        } else {
            $(this.element).slideUp();
        }
    }
});
var viewModel = kendo.observable({
  slideChecked: true
});
kendo.bind(document.body, viewModel);
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy