Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

How to clear search in all tables on page

$
0
0
I have 2 tables on a page, loaded in tabs. They work great but I have a custom search element and am dropping the search into the Dom using jquery append().

// APPEND THE SEARCH DIV TO THE DROPDOWN LI
$('div.dataTables_filter').each(function(){
	$(this).parent('.dataTables_wrapper').prev('.tableSearch').find('.search-dropdown').append(this);				
});

The first search clears fine but the second one won't clear.

// CLEAR SEARCH
$('span.clear-search').click(function(){
	$('li.search-dropdown input').val("");
	$('a.searchIcon .icon-filter').hide();
	$('a.searchIcon .icon-search').show();
	oTable.fnFilter("");
});

I am instantiating them based on a shared class name .tablesort

http://papershare.ravennainteractive.com/d3/

Viewing all articles
Browse latest Browse all 1816

Trending Articles