Can you show the controller code in your jsGrid definition?
You add an insertItem property to the controller object. It should be something like:
controller: {
loadData: ... code to load data to grid ....
,
insertItem: function(item) {
return $.ajax("/api/users/", {
method: "POST",
data: { item },
error: (jqXHR , status, err) => {
alert("Error: " + jqXHR.responseText");
},
success: (result, status, jqXHR) => {
console.log(result);
}
},
...
item will contain the new row that you have added. The above assumes you have a backend web service /api/users listening for HTTP POST.
If the web service returns a 200 status code, the grid showing the input fields will close and the row will be in the read mode. If the return code is other than 200, the grid input row will remain in the data entry mode.