jQuery version

Mar 4, 2009 at 2:35 AM
This didn't work if I referenced the latest version of jQuery (1.3.2 as of Mar 3), but I changed to the older 1.2.6 version and it worked.
Mar 8, 2009 at 10:56 PM
Edited Mar 8, 2009 at 10:57 PM
The method for adding custom expresssions has changed from 1.2.6 to 1.3.x so you have to change the code from:
 jQuery.extend(jQuery.expr[':'], {
   containsIgnoreCase: "(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())>=0"
 });

To:
 jQuery.extend(jQuery.expr[':'], {
   containsIgnoreCase: function(a,i,m) {return (a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())>=0}
 });

Maybe this is not the full answer, but i'm new to jQuery...

Regards
Alexander
Mar 18, 2009 at 4:09 PM
Thanks Alexander!

I will look into this and provide an updated version asap.

Thanks again.

Jaap Vossers
Apr 14, 2009 at 9:23 PM
Thank you all for noting the jquery version issue.  As soon as I read this, I tried it.  I too was using 1.3.2, so I tried Alexander's smart suggestion and my list is working great.

Jaap, a million thanks for a really slick solution.
Suzanne
Apr 16, 2009 at 6:29 PM
Nice work, I ran into a small bug. I am trying to work it out now. When adding this, with the updated script it works perfectly. If you modify the view to display the totals, even just one column it disables this script. No error, just not function. I am trying to identify when tht row for the column totals displays it freezes this script. Maybe it is related to the row count.

Any way great job, if I find the solution I will post.
Sep 11, 2012 at 7:33 AM

Does this work with SP 2010 lists? I like this tool
Thanks in advance

Sep 11, 2012 at 1:39 PM

naijacoder:

Do you mean "Does SPServices work with 2010?" If so, then the answer is "Absolutely!" Note the "certification" icons on the functions.

M.

Sep 12, 2012 at 3:36 AM

M i know SpServices work with 2010 actually doing something with it right now :)
My question was regarding InstantListFilter?

Cheers

Sep 12, 2012 at 1:55 PM

Oops, sorry. This alert went into my SPServices folder. ;+)

M.

Oct 5, 2012 at 12:48 AM

I got this running in a SharePoint 2010 Server environment usingjquery 1.7.2.  Including the above change into the code.

Below is the exact code I used, which I simply put into a html form webpart (waaayy better to use than CEWs) with proper referencing.  Also to note, I already have jquery 1.7.2 reference on the masterpage, otherwise you will need to put that reference BEFORE this code in your webpart.

// SharePoint InstantListFilter - developed by Jaap Vossers

$(document).ready(function()
{	
//	jQuery.extend(jQuery.expr[':'], {
//	  containsIgnoreCase: 

"(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase()

)>=0"
//	});
	
	jQuery.extend(jQuery.expr[':'], {
   containsIgnoreCase: function(a,i,m) {return 

(a.textContent||a.innerText||jQuery(a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())

>=0}
 });
	
	$("table.ms-listviewtable tr.ms-viewheadertr").each(function()
	{
		if($("td.ms-vh-group", this).size() > 0)
		{
			return;	
		}
		
		var tdset = "";
		
		var colIndex = 0;
		
		$(this).children("th,td").each(function()
		{
			if($(this).hasClass("ms-vh-icon"))
			{
				// attachment
				tdset += "<td></td>";
			}
			else
			{
				// filterable
				tdset += "<td><input type='text' class='vossers-filterfield' 

filtercolindex='" + colIndex + "' /></td>";				
			}
			
			colIndex++;
		});
		
		var tr = "<tr class='vossers-filterrow'>" + tdset + "</tr>";
		
		$(tr).insertAfter(this);
	});	
	
	
	$("input.vossers-filterfield")
		.css("border", "1px solid #7f9db9")
		.css("width", "100%")
		.css("margin", "2px")
		.css("padding", "2px")
		.keyup(function()
		{			
			var inputClosure = this;
			
			if(window.VossersFilterTimeoutHandle)
			{
				clearTimeout(window.VossersFilterTimeoutHandle);
			}
			
			window.VossersFilterTimeoutHandle = setTimeout(function()
			{
				var filterValues = new Array();
				
				$("input.vossers-filterfield", 

$(inputClosure).parents("tr:first")).each(function()
				{				
					if($(this).val() != "")				
					{
						filterValues[$(this).attr("filtercolindex")] = 

$(this).val();
					}
				});		
				
							
				

$(inputClosure).parents("tr.vossers-filterrow").nextAll("tr").each(function()
				{
					var mismatch = false;
					
					$(this).children("td").each(function(colIndex)
					{
						if(mismatch) return;
						
						if(filterValues[colIndex])
						{
							var val = filterValues[colIndex];
							
							// replace double quote character with 2 

instances of itself
							val = val.replace(/"/g, 

String.fromCharCode(34) + String.fromCharCode(34));							
													

							
							if($(this).is(":not(:containsIgnoreCase('" 

+ val + "'))"))
							{
								mismatch = true;
							}						
						}
					});
					
					if(mismatch)
					{
						$(this).hide();
					}
					else
					{
						$(this).show();
					}		
				});				
				
			}, 250);
		});
});
Sep 16, 2013 at 11:20 PM
Is there any way to run this without using the jsapi.js file? I have a copy of the jsapi.js, but I see that it makes all its calls externally out to google. We're not allowed to have external calls like that.
Nov 21, 2013 at 8:24 AM
I would like to use this for more than 1000 items in a list. Could someone help me plz
Feb 4, 2015 at 3:58 PM
I know this may be a long shot, but is there anyone this code could work with SharePoint 2013?