Column not searchable but filterable

Column not searchable but filterable

vertisanvertisan Posts: 7Questions: 2Answers: 0
edited January 2017 in Free community support

Hi!
How can I set single column for no global search BUT for filter?
My DT:

    var table = $('#users-table').DataTable({
        "ordering": false,
        "bLengthChange": false,
        pageLength: 50,
        "bDeferRender": true,

        processing: true,
        serverSide: true,
        ajax: '/route',
        columns: [
            { data: 'firstname', name: 'firstname' },
            { data: 'lastname', name: 'lastname' },
            { data: 'list', name: 'list' },
            { data: 'badge', name: 'badge' },
            { data: 'status', name: 'status', orderable: false, searchable: false }, 
// I want to custom filter for this (status) but it cannot be searchable
            { data: 'action', name: 'action', orderable: false, searchable: false }
        ],
        "language": {
            "url": "//cdn.datatables.net/plug-ins/1.10.13/i18n/Polish.json"
        },

    });

Here is my custom filter:

    $('#status').on('change',function(){
        table
            .columns(4)
            .search( this.value )
            .draw();
    });

Answers

This discussion has been closed.