Prevent particular column send request in Server-side

Prevent particular column send request in Server-side

Gobinda NandiGobinda Nandi Posts: 6Questions: 2Answers: 0

i want to prevent first column(inlcudes header and body both) activity for server-side processing.

Answers

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

    Hi @Gobinda Nandi ,

    It shouldn't be sent/requested if you set up the column like this example here - columns.data is set to null so it's not being associated with any of the data.

    Cheers,

    Colin

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

    Hi @Gobinda Nandi ,

    It shouldn't be sent/requested if you set up the column like this example here - columns.data is set to null so it's not being associated with any of the data.

    Cheers,

    Colin

  • Gobinda NandiGobinda Nandi Posts: 6Questions: 2Answers: 0

    Hi @colin
    I think it will work, but still need little help with this code. if i add column.data, datatable destroying. thanks in advance.

    var TableDatatables = function () {
        let init1 = function () {
            let table = $('#attr-tbl-id');
            window.tblServerside = table.DataTable({
                responsive: true,
                serverSide : true,
                processing : true,
                bStateSave: true,
                ajax: {
                    url: 'attribute/get_attr',
                },
                colReorder: {
                    reorderCallback: function () {
                        console.log( 'callback' );
                    }
                },
                "order": [
                [0, 'asc']
                ],
                "lengthMenu": [
                [5, 10, 15, 20, -1],
                [5, 10, 15, 20, "All"]  
                ],
                "pageLength": 20,
                "dom": "<'row' <'col-md-12'B>><'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>", 
            });
        }
        return {
            init: function () {
                if (!jQuery().DataTable) {
                    return;
                }
                init1();
            }
        };
    }();
    
    
  • Gobinda NandiGobinda Nandi Posts: 6Questions: 2Answers: 0

    Hi @colin

    I am using this code and it worked good.If yousee any error please comment. Your help is appriciated. I am posting the code, this maywill help somebody

    "columns": [
    {
        "orderable": false,
        render: function ( data, type, row, meta ) {
            return '<div class="md-checkbox"><input id="checkbox-attr-row-'+ meta.row +'" type="checkbox" class="md-check checkbox-rows"><label for="checkbox-attr-row-'+ meta.row +'"><span></span><span class="check"></span><span class="box"></span></label></div>';
        } 
    },
    {},
    {},
    {},
    {},
    {}
    ],
    
This discussion has been closed.