When submitting via checkbox, the entire row is submitted instead of just the checkbox and row ID.
When submitting via checkbox, the entire row is submitted instead of just the checkbox and row ID.
I have followed the example https://editor.datatables.net/examples/api/checkbox.html to have a checkbox visible and save when changed. However, when it submits, it sends all columns in the row instead of just the checkbox. What do I need to do to have "submit: 'changed'" for this action?
Here is the code that submits (from the example)
$('#example').on( 'change', 'input.editor-active', function () {
editor
.edit( $(this).closest('tr'), false )
.set( 'active', $(this).prop( 'checked' ) ? 1 : 0 )
.submit();
} );
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You would need to set the main form options. Even though the checkbox is inline this is not considered to be inline editing. Confusing ...
https://editor.datatables.net/reference/option/formOptions.main
https://editor.datatables.net/reference/type/form-options#submit---What-values-should-be-submitted-to-the-server
In your case it should be something like this:
Fantastic! I figured submit:changed had to factor in there someplace!