How to add extra information in Ajax?

How to add extra information in Ajax?

support@kosmos.desupport@kosmos.de Posts: 16Questions: 7Answers: 0

Im traing to add the Parent id to the payload.
This ist not working. as I thought it would. The Payload only has de Row data

    ajax: {
        create:{
            type:'POST',
            url: '/api/v1/budgets/marken/new',
        },
        edit:{
            type:'PUT',
            url: '/api/v1/budgets/marken/edit',
        },
        remove:{
            type:'DELETE',
            url: '/api/v1/budgets/marken/delete'
        },
        data: function ( d ) {
            var selected = tabelleGeschaeftsfeld.row( { selected: true } );  
            if ( selected.any() ) {
                d.pid = selected.data().id;
            }
        }
    },

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    Answer ✓

    Since you are defining separate HTTP methods for each operation I suspect you will need to move the ajax.data option inside each HTTP method along with url and type.

    Kevin

Sign In or Register to comment.