Hello infocho,
Unfortunately, doing such modification will result in a breaking change in the current behavior. The method in question is not used only in the context of the SignalR and others may rely on the behavior you have described.
However, in order to implement the functionality you have described - to not add record if it does not exist in the DataSource, you could implement custom push transport similar to the following:
var
dataSource =
new
kendo.data.DataSource({
// type: "signalr",
"transport"
: {
push:
function
(callbacks) {
hub.on(
"update"
,
function
(result) {
if
(dataSource.get(result.ProductID)) { // check if the record exists
callbacks.pushUpdate(result);
}
});
},
read:
function
(options) {
hubStart.done(
function
(result) {
var data = ["read"];
if (!$.isEmptyObject(options.data)) {
data.push(options.data);
}
hub.invoke.apply(hub, data).done(options.success);
});
hub.on(
"read"
, options.success);
},
update:
function
(options) {
hubStart.done(
function
(result) {
hub.invoke(
"update"
, options.data).done(options.success)
});
hub.on(
"update"
, options.success);
}
},
push:
function
(e) {
var
notification = $(
"#notification"
).data(
"kendoNotification"
);
notification.success(e.type);
},
schema: {
model: {
id:
"ProductID"
}
},
"autoSync"
:
true
});
Regards,
Rosen
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.