Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82718

Bug in postSubmit, submitSuccess events

$
0
0

Good morning Allan,

this code isn't working any longer with the "create" action. It used to work with previous Editor versions but not any longer.

.on( 'postSubmit', function ( e, json, data, action ) {
    if ( action === 'edit' || action === 'create' ) {
        var selected = contractTable.row( {selected: true} );
        if (selected.any()) {
            $.ajax({
                type: "POST",
                url: 'actions.php?action=generateCashFlow',
                data: {
                    table: 'variable',
                    id: json.data[0].DT_RowId.substring(4), //only after "row_"
                    contractId: selected.data().contract.id
                }
            });
        }
    }
    ajaxReloadTbls( [contractTable, cashFlowTable] );
});

with the "create" action json.data is an empty array; no DT_RowId, nothing... I also tried this with the submitSuccess event. Same issue. It works fine with the "edit" action. Could you provide a fix please. Many thanks.


Viewing all articles
Browse latest Browse all 82718

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>