Get usable data for serverside editing
Get usable data for serverside editing
I have been using the Datatable plug in for about 2 years now. I love it. I just paid for the editor and am excited to use it in my .Net projects. I am successfully getting the action string into a service side c# method but my problem is the data object is empty. I could see on my chrome browser that I am passing data but I get nothing on the serverside. The reason I need this is so that I can use entity framework to save the edit and pass back the appropriate Json info. It seems to me that there are no entity framework examples out there. I can do all the entity framework code I just need to usable data. Any advice?
This question has an accepted answers - jump to answer
Answers
Can you show me how you are attempting to read the data on the server-side? It should just be
Request.Form
to get the form parameters.Allan
What I ended up doing was editing the data in the Ajax call:
On server side I get
"{ 'json': '{"13":{"Transaction_Type":"Supplies"}}', 'Action': '"edit"'}"
Once I'm done saving the data I return the following:
My return string matches what this says it should look like.
I do see that this is being returned by checking the network tab on Chrome.
The Editor does not save my changes on the screen but once I reload the page I see the change. I get a "a is not a function" error. How do I solve this? Does my return string look wrong?
Does the Ajax URL for the editor have to be the same exact URL for the data table? Currently my Ajax URL for the editor invokes a method for just editing. Am I a jurox URL for the data table invokes a method for the the entire data table.
Hi @Igorski88 ,
It would do this if Editor isn't receiving the correct response from the server after the edit. Can you post the JSON being returned, please.
No, they can be different - this example demonstrates that.
Cheers,
Colin
Here is my code: Still doesnt work
Editor:
Table:
The Data client to server:
{"7":{"Transaction_Number":"test"}}
The Data from server to client:
{"ID":7,"Description":"bnm","Transaction_Type":"Fee","Transaction_Number":"test","Transaction_Qty":"1","SKU":"QW-CWPW-7W7X","Amount":"7.98","TypeOfEvent":null,"Event_Start":null,"Event_End":null}
The current result:
The row that I edit just gets deleted from the table until I refresh the page then I see the row and the changes. I have spent hours reading the manual. I have tried everything.
Right - so the issue is that the data being returned from the server is not quite what Editor is expecting.
This would do it:
Allan
Allan,
I really appreciate your support. One of the biggest reasons I decided to buy the editor is because of you continued support.
I have done just as you said from the very beginning. Please see opening post. when I do that I get an error:
I only get that error when the following is returned from server to client after an edit:
SOLVED:
I had to update my DataTable to 1.10.20(latest)
Ah - you might have been using 1.10.16 or earlier? There was a fix in Editor that also needed an update in DataTables. I think it was 1.10.17 or thereabouts.
Good to hear you have it working now.
Allan