set

Sets the value of the specified field.

Parameters

name String

The name of the field whose value will be returned.

value Number|String|Date|Object

The new value of the field.

Example - set the value of a field

<script>
var observable = new kendo.data.ObservableObject({ name: "John Doe" });
observable.set("name", "Jane Doe"); // set the value
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(observable.get("name")); //outputs the new value "Jane Doe"
</script>

Example - set the value of a nested field

<script>
var observable = new kendo.data.ObservableObject({ person: { name: "John Doe" } });
observable.set("person.name", "Jane Doe"); // set the value
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(observable.get("person.name")); //outputs the new value "Jane Doe"
</script>
In this article