refresh
Invoked by the Kendo UI MVVM framework when the bound view-model value is changed. The Binder should update the UI (the HTML element or the Kendo UI widget) to reflect the view-model change.
Example - slide up or down the element when the bound value changes
<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() {
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>