Get value of column for multi delete of rows

Get value of column for multi delete of rows

jigar311982jigar311982 Posts: 70Questions: 31Answers: 0

Hello,

I am trying to doing multiselect and delete of table rows,
I tried below script but i could see that table rows are deleted but i could not pass value (id) to my php so data could not deleted from database,

I have i have some issue here, how can i get value from one of column(which have id) to push in array?

var manager = new Array();
$('.selected').each(function() {
manager.push(this.value);

------------------> complete script<----------------------------
$(document).ready(function() {
var table = $('#managerlist').DataTable();

$('#managerlist tbody').on( 'click', 'tr', function () {
    $(this).toggleClass('selected');
} );

$('#button').on( 'click',function () {




    var manager = new Array();
    $('.selected').each(function() {
    manager.push(this.value);
                                }); 
            jQuery.ajax({
                        url: "<?php echo base_url(); ?>index.php/admin/administration/trash_manager_multi",
                        data: {manager:manager},
                        type: "POST",
                        success:function(data){ 
                                                var rows = table
                                                .rows( '.selected' )
                                                .remove()
                                                .draw();
                                                }
                        });
});
});

Thank you,

This discussion has been closed.