push
Fired when the data source receives a push notification or the pushCreate
, pushUpdate
, or pushDestroy
methods are called.
Event Data
e.items Array
The array of data items that were affected by the push notification.
e.type String
The type of the push notification.
One of the following values:
"create"
"update"
"destroy"
e.sender kendo.data.DataSource
The data source instance which fired the event.
Example - subscribe to the push event during initialization
<script>
function dataSource_push(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.type); // displays "update"
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.items[0].name); // displays "Jane Doe"
}
var dataSource = new kendo.data.DataSource({
push: dataSource_push,
schema: {
model: {
id: "id"
}
},
data: [
{ id: 1, name: "John Doe" }
]
});
dataSource.fetch();
dataSource.pushUpdate({ id: 1, name: "Jane Doe" });
</script>