Why are all fields except edited field set to blank with inline edit and server-side processing

Why are all fields except edited field set to blank with inline edit and server-side processing

PelycoSystemsPelycoSystems Posts: 1Questions: 1Answers: 0

I am following the example at https://editor.datatables.net/examples/inline-editing/options.html
I am using server-side processing.
I use Fiddler 4 to view the exact http traffic to and from my website.
I am using version 1.9.0 of datatables and editor.
(editor is the trial version)

Example AJAX submitted data when editing the last_name column on the example web site:
action=edit
data[row_3][last_name]=Coxuuu

I do not get the AJAX submitted data as in the example web site.
Instead, all fields are submitted and are blank except for the rowid and the field that was edited.
Example AJAX submitted data when editing Sequence column of my web site:
action = edit
data[HELP_1555010621991GRUMBLEcostpor.Test.txt][Delete] =
data[HELP_1555010621991GRUMBLEcostpor.Test.txt][Sequence] = 777
data[HELP_1555010621991GRUMBLEcostpor.Test.txt][Description] =
data[HELP_1555010621991GRUMBLEcostpor.Test.txt][Filename] =
data[HELP_1555010621991GRUMBLEcostpor.Test.txt][Upload Date] =

Changing the editor.inline option submit to any of all, allIfChanged, or changed has no effect.

I can work around the problem on the server side because blanks are not allowed.
With my work around server-side changes are working.
However, other tables I want to edit allow blanks and I will not be able to tell if the user enters a blank into a cell with this behavior.

Javascript snippet:

                editor = new $.fn.dataTable.Editor( 
                {
                    ajax:  "myTestwebsite?__JSScript=JSQ_HelpAdminUpdate",
                    table: '#HelpDocTable',
                    fields: [
                        { label: 'Delete', name: 'Delete'},
                        { label: 'Sequence', name: 'Sequence'},
                        { label: 'Description', name: 'Description'},
                        { label: 'Filename', name: 'Filename'},
                        { label: 'Upload Date', name: 'Upload Date'},
                    ]
                });                 


                // Activate an inline edit on click of a table cell
                $('#HelpDocTable').on( 'click', 'tbody td:nth-child(2),td:nth-child(3)', function (e) {
                    editor.inline( this, {
                        onBlur: 'submit',
                        submit: 'changed'
                    });
                });

Answers

  • allanallan Posts: 61,654Questions: 1Answers: 10,094 Site admin

    Are the other values actually null in the data set? If so, that's the issue. Editor can't represent null as a value in the text input element, so it has to use an empty space.

    If its not that, can you give me a link to a page showing the issue so I can take a look please?

    Thanks,
    Allan

This discussion has been closed.