"Filter" in .each?

Aug 3, 2010 at 4:22 PM
Hi, Can you add a "filter" in the each function so that you for example only get the values with Title contains asdf (I need the filter in the each function not in the CAML) something like $(xData.responseXML).find("z\\:row WHERE ows_Title Contains asdf ").each(function() { });
Aug 4, 2010 at 1:03 AM
check this link to see if it helps you out http://spservices.codeplex.com/Thread/View.aspx?ThreadId=211363
Coordinator
Aug 4, 2010 at 2:49 AM

Be sure to use the selector like this:

$(xData.responseXML).find("[nodeName=z:row]")

See http://sympmarc.com/2009/11/08/sharepoints-web-services-jquery-and-the-zrow-namespace-in-safari-and-chrome/

Why wouldn't you put the filter into the CAML?

M.

Aug 4, 2010 at 8:55 AM

I'm using it to make a joined list view and want to minimize the amount of web service calls. So what I really need is something equal to

<xsl:variable name="Rows" select="../../../Library/Rows/Row[contains(@Activity_x0020_ID, $dvt_ParentRow/@GUID)]" />
To minimize the rows that needs to be checked in the .each loop I would like to do something like
$(xData.responseXML).find("[nodeName=z:row]")-but only the rows where the column Activity_x0020_ID contains parent GUID
btw - the xsl data view didn't work too good in this specific case, complaining about too many lookup columns
Aug 4, 2010 at 10:23 AM

Found it out

$(xData.responseXML).find("[nodeName=z:row][ows_Activity_x0020_ID*='"+activityID+"']").each(function() {
}
Coordinator
Aug 5, 2010 at 1:55 AM

Nice!

M.