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 ::..