Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to filter a DVWP based upon a span tag value. The value is set in a document.ready function. Please show me how to send it the output of a DVWP. I tried to insert it where the $Rows variable is set in the DVWP, but could not do it without errors. Thank you for your help!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can't use something which is set in document.ready (jQuery) to filter a DVWP. The DVWP is evaluated and rendered server-side, and the document.ready runs client-side. Hoever, you can do the filtering client-side with script if you have the superset of items in the DOM.

share|improve this answer
    
Thank you Marc. –  Anonymous Sep 24 '10 at 4:01
    
Hi Marc. I wrapped the entire DVWP inside a div tag. (<div id='filters'>) This hides the DVWP: var $fil = $('#filters'); $fil.hide(); Using a jquery filter function, I tried to effect certain items that meet the criteria. - $(fil).filter(function(index) { return $('@ID', this).val == 2; }).css('background-color', 'red');. Is there another element I can reference to see if the ID is equal to 2. Once I find a match, I'll want to hide that item. Thanks. – Richard70 0 secs ago –  Anonymous Sep 24 '10 at 15:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.