using buttons in datatable to send row data to server

using buttons in datatable to send row data to server

rudrajitrudrajit Posts: 18Questions: 5Answers: 0

I want to have a custom buttom which sends a selected table row data to my server .
Which method / function should i use inside Javascript to send the data to my server?

 buttons:[
               {
                text: 'Send',
                action: function () {
                     var oid = $.map(table.rows({selected:true}).data(), function (item) {
                        return item[3]
                     });
                     var appby = $.map(table.rows({selected:true}).data(), function (item) {
                        return item[2]
                     });
                     var odt = $.map(table.rows({selected:true}).data(), function (item) {
                        return item[1]
                     });
                     var cname = $.map(table.rows({selected:true}).data(), function (item) {
                        return item[4]
                     });
                     var cno = $.map(table.rows({selected:true}).data(), function (item) {
                        return item[5]
                     });
                    alert(cno+" "+cname);
                                  }
            }
          ],

I dont know what to do after this.

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    You would issue an ajax() with the data you want to send - see here for info on that,

    Colin

  • rudrajitrudrajit Posts: 18Questions: 5Answers: 0

    I solved it using FormData and XHR. Thank you

This discussion has been closed.