How to filter and clear filter with a single button

How to filter and clear filter with a single button

sjw01sjw01 Posts: 67Questions: 36Answers: 1
edited September 2021 in Free community support

http://live.datatables.net/vodukizu/1/edit

I have created a button to call a function and filter only Active users.

But, I can't get the button to show them again.

I was trying:
var state = table.state.loaded();
and
var filterForColIdx = state.columns[colIdx].search.search;

but the state keeps returning null

I just want:

If button pressed and filter active = clear filter
If button pressed and filter NOT active = filter col 3 by Active

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    I'm not following, as you haven't got option stateSave enabled. Please can you provide step-by-step instructions on how to replicate the issue you want resolved,

    Colin

Sign In or Register to comment.