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

Special Character "&" in Filter #1843

Open
elli-pirelli opened this issue Sep 12, 2023 · 0 comments
Open

Special Character "&" in Filter #1843

elli-pirelli opened this issue Sep 12, 2023 · 0 comments

Comments

@elli-pirelli
Copy link

elli-pirelli commented Sep 12, 2023

Hi,

I'm using the tablesorter to filter to sort jobs via a API.
One of the Jobs has F&B in the title and when I filter it via dropdown, the entry disappears from the table.

I'm using the widget filter.

$(function() {
	var $table = $('table.jobsort');
	$table.tablesorter({
		theme: 'blue',
		widthFixed: true,
		widgets: ['filter'],
		sortList: [[0,2],[0,1],[0,0]],
		widgetOptions: {
			filter_reset : '.reset',
			filter_ignoreCase  : true,
			filter_searchDelay : 300,
			filter_startsWith  : false,
			filter_matchType : { 'input': 'exact', 'select': 'exact' },
			filter_external : '.search',
			filter_defaultFilter: { 1 : '~{query}' },
			filter_columnFilters: true,
			filter_placeholder: { search : 'Search...' },
			filter_saveFilters : true,
		}
	})
});

$('button[data-column]').on('click', function() {
	var $this = $(this),
	totalColumns = $table[0].config.columns,
	col = $this.data('column'),
	filter = [];
	filter[ col === 'all' ? totalColumns : col ] = $this.text();
	$table.trigger('search', [ filter ]);
	return false;
});

			
$('table.jobsort').on('filterEnd filterReset', function() {
	var c = this.config,
	fr = c.filteredRows;
	if (fr === 0) {
	c.$table.append([
		'<tr class="noData remove-me" role="alert" aria-live="assertive">',
		'<td colspan="' + c.columns + '">Für diese Suchkriterien haben wir leider keine freien Stellen.</td>',
		'</tr>'
	].join(''));
	} else {
	c.$table.find('.noData').remove();
	}
});```
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