Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Via External tablesorter filter: load two datasets #1844

Open
elli-pirelli opened this issue Oct 23, 2023 · 0 comments
Open

Via External tablesorter filter: load two datasets #1844

elli-pirelli opened this issue Oct 23, 2023 · 0 comments

Comments

@elli-pirelli
Copy link

Hi,

I absolutely love the tablesorter but I have a question/request.

I'm using external buttons to preload tablesorter data using data-filter-column and data-filter-text=.
I wonder if it's possible to either always load all rows which are empty on data-filter-column="0" or load a data-set in data-filter-column="0" that is maybe called 'all'?

This is my script:

`$('button[data-filter-column]').click(function() {

var filters = [],

config = $table[0].config,

$t = $(this),

col = $t.data('filter-column'), 

txt = $t.data('filter-text') || $t.text(); 

filters[col === "all" ? config.columns : col] = txt;

$.tablesorter.setFilters( $table, filters );

return false;           

});`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant