how to get case data value in dropdown filter

how to get case data value in dropdown filter

babz2801babz2801 Posts: 1Questions: 1Answers: 0

'''$(document).ready(function () {

        $.ajax({
            url: 'StudentService.asmx/GetStudents',
            method: 'post',
            dataType: 'json',

            success: function (data) {

                $('#datatable').on('processing.dt', function (e, settings, processing) {
                    $('#processingIndicator').css('display', processing ? 'block' : 'none');
                })
.DataTable({

                      initComplete: function () {
                    this.api().columns([3,4]).every(function() {
                        var column = this;
                        var select = $('<select><option value="">ALL</option></select>')
                            .appendTo( $(column.header()).empty() )
                            .on( 'change', function () {
                                var val = $.fn.dataTable.util.escapeRegex(
                                    $(this).val()
                                );

                                column
                                    .search( val ? '^'+val+'$' : '', true, false )
                                    .draw();
                            } );

                        column.data().unique().each( function ( d, j ) {
                            select.append( '<option value="'+d+'">'+d+'</option>' )
                        } );
                    } );
                },

                    paging: true,
                    sort: true,
                    searching: true,
                    scrollY: 450,
                     scrollX: 1800,
                    "lengthMenu": [[19, 25, 50], [19, 25, 50]],
                    columnDefs: [{       
                    type: "salary-grade",                       
                    targets: [3],
                    orderData: [3, 4, 1],


                }],
                order: [[3, "asc"]],
               data: data,
                    columns: [
                        { 'data': 'id' },
                        { 'data': 'name' },
                        { 'data': 'fname' },
                        { 'data': 'CLASS' },
                        { 'data': 'section' },
                        {
                            'data': 'contact',
                            'sortable': false,
                            'searchable': false
                                },                            

                        {
                            'data': 'sex', 'render': function (data, type, row) {
                                switch (data) {
                                    case 'Male': return 'free'; break;
                                    case 'Female': return 'paid'; break;
                                    default: return 'N/A';
                                }

                            }
                        },
                        {
                            'data': 'dob',
                            'render': function (jsonDate) {
                                var date = new Date(parseInt(jsonDate.substr(6)));
                                var month = date.getMonth() + 1;
                                return  date.getDate()+"-" + month +  "-" + date.getFullYear();
                            }
                        },
                        { 'data': 'address' },
                        {
                            'data': 'admdate',
                            'render': function (jsonDate) {
                                var date = new Date(parseInt(jsonDate.substr(6)));
                                var month = date.getMonth() + 1;
                                return date.getDate()+"-" + month +  "-" + date.getFullYear();
                            }
                        },
                        {
                            'data': 'session', 'render': function (data, type, row) {
                                switch (data) {
                                    case '1015': return '2017-18'; break;
                                    case '1016': return '2018-19'; break;
                                    default: return 'N/A';
                                }
                            }
                        },
                        {
                            'data': 'type', 'render': function (data, type, row) {
                                switch (data) {
                                    case 'True': return 'Old'; break;
                                    case 'False': return 'New'; break;
                                    default: return 'N/A';
                                }
                            }
                        }

                    ]
            });

            }
        });
    });
</script>'''
This discussion has been closed.