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

Filter plugin broken #1377

Closed
joaduo opened this issue Apr 3, 2017 · 1 comment
Closed

Filter plugin broken #1377

joaduo opened this issue Apr 3, 2017 · 1 comment

Comments

@joaduo
Copy link

joaduo commented Apr 3, 2017

Looks like filter plugin is broken
https://mottie.github.io/tablesorter/docs/example-widget-filter-any-match.html

Here the stack trace

Uncaught TypeError: Cannot read property 'length' of undefined
    at Object.ts.setFilters (widget-filter.js:1884)
    at Object.bindSearch (widget-filter.js:784)
    at Object.init (widget-filter.js:526)
    at Object.format (widget-filter.js:65)
    at Object.applyWidgetId (jquery.tablesorter.js:2000)
    at Object.applyWidget (jquery.tablesorter.js:2055)
    at Object.setup (jquery.tablesorter.js:320)
    at HTMLTableElement.<anonymous> (jquery.tablesorter.js:2533)
    at Function.each (jquery-latest.min.js:2)
    at r.fn.init.each (jquery-latest.min.js:2)

Originated in the code:

	ts.setFilters = function( table, filter, apply, skipFirst ) {
		var c = table ? $( table )[0].config : '',
			valid = ts.getFilters( table, true, filter, skipFirst );
		// default apply to "true"
		if ( typeof apply === 'undefined' ) {
			apply = true;
		}
		if ( c && apply ) {
			// ensure new set filters are applied, even if the search is the same
			c.lastCombinedFilter = null;
			c.lastSearch = [];
			tsf.searching( c.table, filter, skipFirst );
			c.$table.triggerHandler( 'filterFomatterUpdate' );
		}
		return valid.length !== 0;
	};

May it be related to recent commit?

@Mottie
Copy link
Owner

Mottie commented Apr 4, 2017

Hi @joaduo!

Thanks for letting me know, I'll get this fixed ASAP!

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

No branches or pull requests

2 participants