Clearing YADCF Filters On Load

Clearing YADCF Filters On Load

mRendermRender Posts: 151Questions: 26Answers: 13

"stateSave": true, ..... yadcf.init(oTable, [ { column_number: 0 }, { column_number: 1 }, { column_number: 2 }, { column_number: 3 }, .....

Is there a way to use State Saving to clear the YADCF filters when the page loads, but keep all other sorting and stuff that has been done to the table? Everything I put into the state save parameters or yadcf parameters don't seem to work together to clear the filters of the yadcf.

Answers

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    You should try using the searchCols , set the columns filter to be an empty string and see how it goes for you

  • mRendermRender Posts: 151Questions: 26Answers: 13

    Did not work, I suspect it's because the searchCols refers to the individual search parameters of the datatables searching and not the yadcf search boxes.

    Thanks for trying.

  • mRendermRender Posts: 151Questions: 26Answers: 13
    yadcf.exFilterColumn(oTable, [
    [0, ""],    
    [1, ""],
    [2, ""],
    [3, ""],
    [4, ""],
    [5, ""],
    [6, ""],
    [7, ""],
    [8, ""],
    [9, ""],
    [10, ""],
    [11, ""],
    [12, ""],
    [13, ""],
    [14, ""],
    [15, ""],
    [16, ""],
    [17, ""],
    [18, ""],
    [19, ""],
    [20, ""],
    [21, ""],
    [22, ""]
    ]);
    

    This works. There was an issue where you had to add an extra bracket around each column but that bug has been fixed. You can use this function to basically pre-search on all the columns.

This discussion has been closed.