i am using the ejtreegrid to display and edit my hierarchical data . also i am using the actionComplete event to send data to my asp.net controller to persist data . here the code of my controller :
public int AddFamille(string DESIGNATION)
{
FAMILLE f = new FAMILLE()
{
FA_DESIGNATION = DESIGNATION,
FA_ID_PARENT = 1};
ctx.FAMILLES.Add(f);
ctx.SaveChanges();
return f.ID_FAMILLE;
}
it return the ID of the newly added entity , i have checked that and it's ok .
on the client side here the ajax call
function OnactionComplete(args) {
if (args.requestType == "addNewRow") {
var item = args.addedRow;
$.ajax({
type: "POST",
url: '/Admin/AddFamille?`DESIGNATION='+item.DESIGNATION,`
success: function (data) {
args.addedRow.ID= data;
}
});
}
}
as you can see i am trying replace the added item ID with the new ID that came from the server, but unfortunally it has no effect .
any idea is welcome . thanks