proxyModelSetters
Creates a wrapper object over the passed one, with get/set properties that set the original object dirty
flag. Suitable for a scenario where a dataSource item is used in a third-party MVVM implementation, like AngularJS.
Example
<script>
var dataSource = new kendo.data.DataSource({
data: [
{ id: 1, name: "John Doe", age: 30 },
{ id: 2, name: "Jane Smith", age: 25 }
],
schema: {
model: {
id: "id",
fields: {
name: { type: "string" },
age: { type: "number" }
}
}
}
});
dataSource.read();
var model = dataSource.get(1);
var proxy = kendo.proxyModelSetters(model);
// Changes to the proxy will mark the model as dirty
proxy.name = "Updated Name";
console.log(model.dirty); // true
</script>
Parameters
data kendo.data.Model
The model that will be wrapped.
In this article