Editor with serverSide not refreshing row after POST response
Editor with serverSide not refreshing row after POST response
sij2003
Posts: 3Questions: 0Answers: 0
Hi,
I have dataTables with rails and serverSide=true running nicely. When I add the editor and the simple inline example, I have the following issue...
- I click on the cell and the text correctly changes to an input box
- I enter the new value into the input box
- I hit return and the POST is correctly sent and the response is 200 OK with a row JSON object (see below)
- But now the cell remains an input and does not refresh back to a text cell as it was in (1)
It's as though dataTables doesn't know that the return was a success and keeps the input open for editing with no error or notifications
I am using the trial version of editor
Fiddle: https://jsfiddle.net/jb9e0ov0/
Debug: http://debug.datatables.net/unahag
CSS
<link data-turbolinks-track="true" href="/assets/dataTables.editor.min.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/dataTables/bootstrap/3/jquery.dataTables.bootstrap.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/dataTables/extras/dataTables.tableTools.css?body=1" media="all" rel="stylesheet" />
JS
<script data-turbolinks-track="true" src="/assets/dataTables/jquery.dataTables.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/dataTables/extras/dataTables.tableTools.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/dataTables/bootstrap/3/jquery.dataTables.bootstrap.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/dataTables.editor.min.js?body=1"></script>
POST request
action: edit
data[email]: jdo123@med.cornell.edu
data[first_name]: John
data[last_name]: Doe
id: 8263
POST response
200 OK
"row": {"last_name":"Jane", "first_name":"Mary", "id":"1", "mja123@med.cornell.edu":"1", "lims":"1234", "groups":"1234"}
Any suggestions would be great
Thanks
Simon
This discussion has been closed.
Replies
Hi Simon,
What you are seeing is normally down to another field not being valid, but the JSON response you are getting suggests that isn't what is happening in this case.
Rather, my guess is that there is a Javascript error occurring on the page. If you look at your browser's debug console, is there any error reported?
Regards,
Allan
Hi Allan,
Thanks for the info - unfortunately there's definitely no Javascript errors reported in firebug, which is why I'm having so much trouble debugging it.
Could it be an issue with turbolinks perhaps? Or could missing/overridden stylesheets cause this problem? Like I said, dataTables appears/works perfectly so I'm not sure what's going on.
Cheers
Simon
Turbolinks isn't something that I have used before, so I'm afraid I can't really offer anything insightful in that regard. Are you able to give me a link tot he page you are working on so I can debug it? You can send me a PM by clicking my name above and then the "Send message" button if you want the link to remain private.
Allan
Hi Allan,
Thanks for the help and offer - unfortunately it's locked-down so I can't provide a link (and heavy on the Javascript and ajax so can't recreate it statically) but I've for a work-around for now.
Cheers
Simon