SharePoint 2010: Extended Live Filtering For Lists and Libraries

SharePoint Search is working well. But sometimes you do not need a search, you just need a filter function that’s seems like a search. We extended some script from the internet with cookies to send filter values from one page to another. So now you are able to filter a current page by typing word phrases into an input box and if you navigate to another page the filter value is set by the cookie.

Part 1

Therefore we need two Parts. Part 1 is a CEWP which is placed above the list we want to filter. Within this CEWP we place the following code:

[sourcecode language=”javascript”]

Live Filter on Current Page:
[/sourcecode]

The value of minimalCharacters declares a minimal amount of characters for starting a search.

Part 2

Within Part 2 we place a CEWP under the list we want to filter. Here we just read the cookie value to filter the page if it is refreshed e.g. by paging.

[sourcecode language=”javascript”]
var cookie = “” + read_cookie(“P120680”);
document.forms[0].t_in.value = cookie;
quickSearch(cookie);
[/sourcecode]

The result looks like this:

On the first 3 results we filter for “un” and will get Hunter as filter result.

If we click on paging arrows to navigate to the next page the filter is already set to “un” and the list is already filtered.

Thanks to Christian Smierzchalski for helping to figure this out.

..:: I like SharePoint ::..

The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.

About Dennis de Vries 34 Articles
Loving SharePoint, Social Media and like to work together with creative people all over the world.