ASPX.NET How to get table to update after CREATE
ASPX.NET How to get table to update after CREATE
spickens
Posts: 24Questions: 7Answers: 0
My software successfully creates a new user on the server via the Editor. It successfully sends the new user to my aspx.net c# webmethod. So good so far.
The webmethod returns a json string with the data sent. I want to update the table, adding the new user. From my reading, it seems like I have to do this in the postSubmit() event. Several questions:
- The postSubmit() event has 4 parameters (e, json, data, action). It's my understanding that the json parameter contains the json string returned from my webmethod. Is this Correct?
- What is the next step: Do I JSON.parse(json)? If so, where do I put the object?
- What is in the data parameter?
This discussion has been closed.
Answers
What is the JSON format that the server is currently responding with? What Editor expects is documented here.
Allan
Below is my postSubmit function.
Below are what Chrome displays for the content of the function's "json" parameter. The server returns a json string.
d: "{"data":{"SALUTATION":"Test6","FIRSTNAME":"test6","LASTNAME":"test6","USERNAME":"spcc6","ENABLED":"0","id":7}}"
proto: Object
Below is what Chrome displays for the content of the function's "data" parameter.
action: "create"
data:
0: {SALUTATION: "Test6", FIRSTNAME: "test6", LASTNAME: "test6", USERNAME: "spcc6", ENABLED: "0"}
proto: Object
proto: Object
My question is, do I need to do something with the "json" parameter in order to get the table to automatically update. The idsrc = 'id'. The majority of the client-side code is below.
You need to modify the data returned from the server to match the form that Editor expects. That could be done with:
i.e. take the
d
string from the object and convert it to JSON and assign it into an array which is attached to json.data.Allan