set

Sets the value of the specified field. 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" },
        inStock: { type: "boolean", defaultValue: true }
    }
});

var product = new Product({ name: "Tablet", price: 299 });

/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(product.get("name")); // outputs "Tablet"

// Set new values
product.set("name", "iPad Pro");
product.set("price", 1099);
product.set("inStock", false);

/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(product.get("name")); // outputs "iPad Pro"
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(product.get("price")); // outputs 1099
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(product.get("inStock")); // outputs false
</script>
In this article
set
Not finding the help you need?
Contact Support