Does Inline editing support the submit:all parameter?

Does Inline editing support the submit:all parameter?

ThomDThomD Posts: 334Questions: 11Answers: 43

Editor 1.5, Databases 1.10.8

I'm using in line editing with this setup.

        $('#example').on( 'click', 'tbody td.dt-edit', function (e) {
            dtEditor.inline( this,{
                buttons: { label: 'OK', 
                             submit: 'all', 
                              fn: function () { this.submit(); }
                }
            } );
        } );

With the move to 1.5 I don't seems to have access to the other fields in the row. I need to other fields as keys to send back to the server for my ajax call. I thought that the 'all' parameter would make all the fields visible in the preSubmit fuction, but I'm only getting the one field that I edit.

This question has an accepted answers - jump to answer

Answers

  • ThomDThomD Posts: 334Questions: 11Answers: 43

    Answering my own question, the short answer is no. I found the answer in this thread

    https://datatables.net/forums/discussion/29503/in-editable-when-a-cell-is-edited-edit-automatically-another-cell

    In the on click event of a cell, you can add this:

        $('#example').on( 'click', 'tbody td.dt-edit', function (e) {
            var myRow = this.parentNode;
            dtEditor.inline( this,{
                buttons: { label: 'OK', fn: function () { this.submit(); }
                }
            } );
            dtEditor.on( 'preSubmit', function ( e, data ) {
                data.rowData = dtTable.row( myRow ).data();
            } );            
        } );
    

    This appends the full row data to the data submitted object, so that you can access it.

  • allanallan Posts: 63,686Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Hi,

    Currently no as you say. I think I'm going to need to review this for the next release.

    Allan

This discussion has been closed.