jacekz
February 7, 2016, 1:22pm
1
Hello all,
I have this list with form bound. I use the add method and the new id has its value set. Below I paste the (snipped) output from the console.log(form_values):
Object {
lname: “aaa”
fname: “sss”
sex: “M”
address: “”
group_id: “-1”
email: “”
id: 1454850984141
…}
The temporary ID is autogenerated client-side, as expected.
However, this value is not being sent to the server. I’ve checked with tcpdump and the POST request contains all variables except this one.
I’m using webix 3.1.2, fetched from your CDN (edge).
The result is I’m unable to push the correct ID from the server to the frontend.
I really have no idea what to do, especially it has worked before.
Helga
February 8, 2016, 12:48pm
2
Hi,
Please look at the sample: http://docs.webix.com/samples/40_serverside/01_php_vanila/02_datatable_saving.html . You can check in the console that new item ID is returned from server as { "id":"", "status":"success", "newid":"0" }
and it automatically replaces the auto-generated one.
jacekz
February 9, 2016, 2:02pm
3
Yes, but the new ID is not being applied to the new item.
maksim
February 10, 2016, 4:06pm
4
Can you share the text of server-side response for data saving call. in your case.
It must be a valid JSON with new id value.
jacekz
February 12, 2016, 6:37am
5
Ok, got it working.
I was trying to send back {id: null, status:‘success’, newid: 5}
instead of sending old id as empty string. Thanks both of you!