Yadcf with data range

Yadcf with data range

esaesaesaesa Posts: 6Questions: 2Answers: 0
edited November 2014 in Free community support

Hi
I integrated datatables 1.10 successfully with yadcf both are geat.
But i can't get the range select filter_type: "range_number_slider" to work
My work is straight forward except the the data is mixed between numbers and null or empty string and i use renderer to check it and show zero instead of null but slider is not shown without any error in console. and here is my complete script

                         $(document).ready(function () {
            var myTable = $('#example').DataTable({
                ajax: "CRUD1.php",
                "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
                "pagingType": "full_numbers",
                "columnDefs": [
                    {
                        // The `data` parameter refers to the data for the cell (defined by the
                        // `data` option, which defaults to the column being worked with, in
                        // this case `data: 0`.
                        "render": function (data, type, row) {
                            if (!(data > 0))
                            {
                                return '<span style="color:red;">0</span>';
                            }
                            else {
                                return   data;
                            }

                        },
                        "targets": [4]
                    },
                    {"visible": true, "targets": [3]},
                    {
                        // The `data` parameter refers to the data for the cell (defined by the
                        // `data` option, which defaults to the column being worked with, in
                        // this case `data: 0`.
                        "render": function (data, type, row) {
                            if (!(data > 0))
                            {
                                return '<span style="color:red;">0</span>';
                            }
                            else {
                                return   data;
                            }

                        },
                        "targets": [5]
                    }
                ],
                columns: [
                    {
                        data: "type_name"
                    }
                    ,
                    {
                        data: "Sp"
                    }
                    ,
                    {
                        data: "Po"
                    }
                    ,
                    {
                        data: "Cl"
                    },
                    {data: "Count_id"},
                    {data: "ideal"}
                ]
            });
            yadcf.init(myTable, [
                {column_number: 0,
                    filter_type: "multi_select",
                    select_type: 'select2'
                },
                {column_number: 1
                },
                {column_number: 2},
                {column_number: 3},
                {column_number: 4,
                    filter_type: "range_number_slider"
                },
                {column_number: 5}//
            ]);

        });

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.