Datatable editor not updating , not seeing an update query in DevTools
Datatable editor not updating , not seeing an update query in DevTools

I have a data table (Addresses) who edit button opened AddressEditor and it contains two datatable fields called: residents and comments. Residents and Comments are both children of Addresses.
I am working on the edit for comments. When I click edit, the commentsEditor form opens and I can make chnages. When I click update, the update isn't posted back to the server.
I have debug enalebed in Addresses_Comments_Nested_DT.php, the php file and below are the contents from $_POST:
$_POST= {"data":{"row_26":{"Resident":"","ActLogDT":"2025-07-17 00:13:37.243","ActLogComments":"my updated commets","ReqFollowUp":"0","FollowedUp":"0"}},"action":"edit","AddressAID":"56"}
I don't see any errors in DevTools but I also don't see an update query in DevTools under Fetch/XHR Preview for Addresses_Comments_Nested_DT.php
This question has an accepted answers - jump to answer
Answers
This is the contents of my Addresses_Comments_Nested_DT.php
I removed other fields except the ids and comments. I haven't been able to isolate why the php editor isn't attempting to create an update query.
Here is the reduced $_POST as reported by the PHP, attaching a screenshot of devtools. I spent about 8 hours on this today, I learned a bunch of stuff, just not what is happening.
here is a link link, the steps are to click on edit address, go down to the comments, select either one and edit.
https://jyorkejudge.org/Addresses.php
$_POST= {"data":{"row_26":{"ActLogComments":"update me"}},"action":"edit","AddressAID":"56"}
Thanks for the link. It appears that the edit for the comments is being submitted and this is was is being sent:
This is the response from the server:
So it is being submitted, but not acted upon.
The problem - at least part of it - is that you have:
But in the JS for the field use
name: 'ActLogComments'
, which tells Editor to submit the value with that name. I.e. it doesn't match the field name the server is expecting. Can you remove thename
property for the field and just use thedata
one, which appears to be correct.Allan
Thank you for getting me on the right path. I was so discouraged that I could not figure this out.
I tried removing name: 'ActLogComments', from the editor definition and I received an error:
Uncaught Error: Error adding field. The field requires a
name
optionBecause of your comments, I saw the name was just 'ActLogComments' was missing the table name. So I modified it to:
name: 'ActLog.ActLogComments' and it's working.
Since that is working, now I am going to try to figure out the soft delete.
Doh, sorry. I should have said keep
name
but update it to the value ofdata
and then removedata
!Good to hear you have it working now.
Allan