editor event function parameter

editor event function parameter

jfrjfr Posts: 71Questions: 24Answers: 0

Hi

It seem that I am missing the data in all the editor event
ex preSubmit function( e, data, action )
the e is the jQuery object and the data is the action ex 'edit'
I checked submitComplete and postSubmit with the same missing function parameter
I am trying to do a Simple standalone editing with datatable 1.10.12 and editor 1.5.6

Thanks in advance

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Can you give me a link to a page showing the issue please?

    Using this example if I run:

    editor.on( 'preSubmit', function ( e, data, action ) {
      console.log( data, action );
    } );
    

    in the console, and then submit a change, I can see the data and the action being output.

    Allan

  • jfrjfr Posts: 71Questions: 24Answers: 0

    Hi Allan

    Try like this
    Am I wrong using the event instead of the on ?

        editor = new $.fn.dataTable.Editor( {
          "events" : {
            "preSubmit": function ( e, data, action) {
              console.log( e, data, action );
             }
          },
          ajax: "../php/staff.php", ...
    
This discussion has been closed.