transfer selected table's row to server

transfer selected table's row to server

student.colognestudent.cologne Posts: 1Questions: 1Answers: 0

hello,
sorry, i am not a javascript specialist. How can i transfer the selected row (practically my objects from server) back to the server in form of json-format ?

i did try to do it with this approach, but it doesn't work:

    $('#save_btn').click( function () {
            //table.row('.selected').remove().draw( false );
            console.log ( table.rows('.selected').data());


            var stringData = table.rows('.selected').data().serialize();
            $.ajax({
                url: '${pageContext.request.contextPath}/ajax/storeSelectedContacts',
                data: stringData ,
                type: "POST",
                cache: false,
                success: function (savingStatus) {
                   alert("success");
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert("error")
                }
            });

        } );

many thanks

This discussion has been closed.