How to get values of multi selected rows

How to get values of multi selected rows

kaustubh.agrawal2000kaustubh.agrawal2000 Posts: 81Questions: 35Answers: 2

Hello,

I have a datatable created like below..

I am using select 1.2.3 plugin and I am able to select multiple rows.. but when I am trying to get the data of selected row
it only returns the first row data and not of all the rows..

       receiptTable = $('#receiptModalTable').DataTable( {
            dom:  "RBt",
            ajax: base_url + 'api/partyreceipt?' + $.param(_params), 
            idSrc:  'receipt_id',
            select: {
                style: 'multi'
            },
            autoWidth: false,
            columns: [
                { data: "dispatch.parent_id" },
                { data: "receipt_id" },
                { data: "dispatch.dispatch_id"},
                { data: "receipt_date"},
                { data: "delivered_weight"},
            ],
            buttons: [
                {
                    text: 'Use Selected Receipts',
                    action: function ( e, dt, node, config) {
                        var data = receiptTable.row('.selected');
                        console.log(data);
                            //var receiptId = data['receipt_id'];
                        //editor.field('purchase_parent_id').val(receiptId);
                        //editor.field('dispatch.dispatch_id').val(data['dispatch']['dispatch_id']);

                        //$('#receiptModal').modal('hide');
                    }
                }
            ]
        });

There is no documentation related to getting data for all the rows..

Kindly help..

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.