set
Fires when the set
method is invoked. Inherited from kendo.data.ObservableObject
. For more information and examples, refer to the set
API reference.
Example
<script>
var Product = kendo.data.Model.define({
fields: {
name: { type: "string" },
price: { type: "number" },
available: { type: "boolean" }
}
});
var product = new Product({ name: "Headphones", price: 149, available: true });
// Bind to the set event
product.bind("set", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("Set event fired for field: " + e.field);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("New value being set: " + e.value);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("Previous value: " + e.previousValue);
});
product.set("name", "Wireless Headphones"); // triggers set event
product.set("price", 199); // triggers set event
product.set("available", false); // triggers set event
</script>
In this article