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

Cannot trigger filter manually #838

Closed
webbick opened this issue Jan 20, 2019 · 1 comment
Closed

Cannot trigger filter manually #838

webbick opened this issue Jan 20, 2019 · 1 comment

Comments

@webbick
Copy link

webbick commented Jan 20, 2019

Hi, I've read a lot of posts but cannot find an answer.
I created a link. When clicked on, some JS copies a string into the search field. I know that that's not enough to start the filter. I need to trigger it, but I cannot get it to work. Please help.

This is the JS of the link (id=onderwerp):

$('#onderwerp').click(function () {
    $('.form-control').val('some string');    // copy string to footable search field. THIS WORKS!
    $('.w-footable').trigger('footable_filter', { filter: $('.form-control').val() });
});
@webbick
Copy link
Author

webbick commented Jan 21, 2019

Ooo, wait, I was stuck in V2 code instead of V3...which is completely different!
Solved:
$('#onderwerp').click(function () {
var filtering = FooTable.get('.w-footable').use(FooTable.Filtering), filter = 'some string';
filtering.addFilter('status', filter, ); // no value after last comma means search in ALL columns
filtering.filter();
$('.form-control').val('some string');
});

@webbick webbick closed this as completed Jan 21, 2019
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