Hello,
I've a grid with a custom datasource
01.
.DataSource(dataSource => dataSource
02.
.Custom()
03.
.Batch(
true
)
04.
.Schema(s =>
05.
s.Model(model =>
06.
{
07.
model.Id(p => p.ID);
08.
})
09.
)
10.
.Transport(
new
11.
{
12.
read =
new
Kendo.Mvc.ClientHandlerDescriptor() { HandlerName =
"customRead"
},
13.
create =
new
Kendo.Mvc.ClientHandlerDescriptor() { HandlerName =
"customCreate"
},
14.
update =
new
Kendo.Mvc.ClientHandlerDescriptor() { HandlerName =
"customUpdate"
},
15.
destroy =
new
Kendo.Mvc.ClientHandlerDescriptor() { HandlerName =
"customDestroy"
},
16.
})
17.
)
It works as expected but I'm trying to build a grid which will send in ONLY ONE request all the created, updated and destroyed items to the server.
Out of the box the grid will send one request with all created items, another request with all updated items and another request with all destroyed items but searching here and there I got it working the way I need.
Now I'm facing only one problem and it's in the customUpdate and customDestroy handlers. Here's the customUpdate handler
1.
function
customUpdate(e) {
2.
e.success();
3.
}
Basically what I'm saying is: when the user update or destroy a row DOES NOTHING. I'll do all the updates when the user click a custom save button I've implemented.
The problem is that after the e.success() method is called the datasource remove the state of the row (updated, destroyed) so this is what I need:
Is it possible to execute some code right away after the whole code inside e.success() finished?
PD: I've realized that when e.success() call is finished the status of the rows isn't changed yet (updated, destroyed) so I need to be able to execute some code after the whole code inside e.success() is executed.
Thank you.