1

Is there a way in JQuery Datatables to get the current filter status of a column? I am doing some custom filtering and have bStateSave set to true. When the page reloads I would like to read out the current filter state in order to populate a different portion on my page.

1 Answer 1

6

For anybody still looking (like I was):

    var oSettings = oTable.fnSettings();
    $("tfoot input").each(function(i){
        if(oSettings.aoPreSearchCols[i]['sSearch']!=''){
            $(this).val(oSettings.aoPreSearchCols[i]['sSearch']);
        }
    });
    if(oSettings.oPreviousSearch['sSearch']!=''){
        $('.search_field').val(oSettings.oPreviousSearch['sSearch']);
    }

taken from http://www.datatables.net/forums/discussion/992/solved-override-bstatesave-with-osearch-and-aosearchcols/p1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.