lundi 7 août 2017

How to pass values of a column of rows whose checkboxes are selected in jQuery Data Table

I have a datatable which is getting populated by an ajax call. Following is the code:

oTable = $('#lenderList').dataTable(
        {
            bServerSide: true,
            bProcessing: true,
            searching: true,
            sAjaxSource: "loanAdminAjax?ajax=true&searchCol="+$('#category').val(),
            sServerMethod: 'POST',
            sPaginationType: "full_numbers",

            columnDefs:[
                {
                    targets:8,
                    checkboxes:{
                        selectrow:true
                    }
                }
            ],
            aoColumns: [
                {
                    "sName": "loanApplicationNumber",
                    mData: "loanApplicationNumber"
                },
                {
                    "sName": "name",
                    mData: "name"
                },
                {
                    "sName": "submissionDate",
                    mData: "submissionDate"
                },
                {
                    "sName": "kycEmailId",
                    mData: "kycEmailId"
                },
                {
                    "sName": "appVersion",
                    mData: "appVersion"
                },
                {
                    "sName": "documentStatus",
                    mData: "documentStatus"
                },
                {
                    "sName": "latestRemark",
                    mData: "latestRemark"
                },
                {
                    "sName": "appName",
                    mData: "appName"
                },
                {
                    nData:   "salaryTransaction",
                    render: function ( salaryTransaction, type, row ) {
                        if ( type === 'display' ) {
                            return '<input type="checkbox" class="editor-active">';
                        }
                        return salaryTransaction;
                    },
                    className: "dt-body-center"
                }
            ],
            dom: '<"button">lfrtip'
        }
    );
});

I have to consider all the loan application numbers of the respective rows whose checkboxes are checked by the user. So I can trigger an event on Click of a button but how can I get the values of Loan Application Number of those rows whose checkboxes are clicked.

I am new to javaScript. Please let me know how this can be achieved.




Aucun commentaire:

Enregistrer un commentaire