Hi.
I'm using grid and I can't find a normal solution to execute some code after successful item update on the server.
The most obvious solution to me was to use update function with ajax (as in documentation samples). But it doesn't work. There are some work arounds on SO I found, but they seems not good to me. Handling grid save event is not useful because it is raised before server update. Also I tried to use requestEnd event on ds, but it is not obviouse how to differentiate success and error request. And the more important thing is that I have no access to updated item in the requestEnd handler.
So the question: is there some mechanisms to execute some js code with updated item after successful server update within grid?
If it is important, I use angular-kendo.
Thanks in advance.
I'm using grid and I can't find a normal solution to execute some code after successful item update on the server.
var
ds =
new
kendo.data.DataSource({
transport: {
read: {
url:
'stations'
,
dataType:
'json'
},
update: {
url:
'stations'
,
dataType:
'json'
,
type:
'PUT'
},
destroy: {
url:
'stations'
,
dataType:
'json'
,
type:
'DELETE'
},
create: {
url:
'stations'
,
dataType:
'json'
,
type:
'POST'
},
parameterMap:
function
(data, operation)
{
if
(operation !==
"read"
&& data)
{
return
JSON.stringify(data);
}
}
},
batch:
false
,
schema: {
model: {
id:
"Id"
,
fields: {
//some fields... }
}
}
});
The most obvious solution to me was to use update function with ajax (as in documentation samples). But it doesn't work. There are some work arounds on SO I found, but they seems not good to me. Handling grid save event is not useful because it is raised before server update. Also I tried to use requestEnd event on ds, but it is not obviouse how to differentiate success and error request. And the more important thing is that I have no access to updated item in the requestEnd handler.
So the question: is there some mechanisms to execute some js code with updated item after successful server update within grid?
If it is important, I use angular-kendo.
Thanks in advance.