Restore original data after $.fn.dataTable.ext.search.push

Restore original data after $.fn.dataTable.ext.search.push

alderhernandezalderhernandez Posts: 33Questions: 11Answers: 1
edited August 2016 in Free community support

how I can restore origianal information after $.fn.dataTable.ext.search.push

i am tryn this but doesn work, plis help me!!

i use a checkbox to filter values > 0 in one colum or not

if($("#test5").is(':checked')) {
                         $.fn.dataTable.ext.search.push(
                                function( settings, searchData, index, rowData, counter ) {
                                    var min = 0.00;
                                    var valor = parseFloat( searchData[6]); // using the data from the 6th column                              
                                    if (( isNaN( min )) || ( valor != min))                                       
                                    {
                                        return true;
                                    }
                                    return false;
                                }
                            );  
                    }

                     else {
                        $.fn.dataTable.ext.search.push(
                            function( settings, searchData, index, rowData, counter ) {
                                var min = 0.00;
                                var valor = parseFloat( searchData[6]); // using the data from the 6th column                            
                                    return true;                                
                            }
                        );
                    }        

Replies

  • hthaccounththaccount Posts: 1Questions: 0Answers: 0

    add $.fn.dataTable.ext.search.pop(); like this:
    $.fn.dataTable.ext.search.push(
    function( settings, searchData, index, rowData, counter ) {
    var min = 0.00;
    var valor = parseFloat( searchData[6]);
    if (( isNaN( min )) || ( valor != min))
    {
    return true;
    }
    return false;
    }
    );
    $.fn.dataTable.ext.search.pop();

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin

    This plug-in can be used to restore ordering to the order that the data was read in.

    Allan

This discussion has been closed.