bind
Attaches a handler to an event. For more information and examples, refer to the bind
API reference.
Example
<script>
var Product = kendo.data.Model.define({
fields: {
name: { type: "string" },
price: { type: "number" }
}
});
var product = new Product({ name: "Laptop", price: 999 });
// Bind to the change event
product.bind("change", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("Field '" + e.field + "' changed to: " + e.value);
});
product.set("name", "Gaming Laptop"); // triggers change event
product.set("price", 1299); // triggers change event
</script>
In this article