3

I have employed a Query String Filter to parse a value and send it to a chart web part. now I would like to use this value in a CEWP to provide an explaination/clarification for the chart, but the CEWP does not allow connections.

Is there a way to grab this value from the Chart or Filter in the CEWP embeded javascript. ( Designer is not available where I work )

1

You can easily use JQuery to get the filter by partial id. SPTextSlicerValueTextControl is the end of the ID of a SharePoint text filter input field.

filterValue = $('input[id*=SPTextSlicerValueTextControl]');

0

I used this code:

function GetValue(name)
{
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( unescape(window.location.href) );
    if( results == null )
        return "";
    else
        return results[1];
}

Source: http://kancharla-sharepoint.blogspot.co.at/2012/03/javascript-code-to-get-query-string.html

  • This would be a fine way to grab the value from the URL. – Hank Feb 12 '13 at 16:38
  • I raised the question because I was looking for a way to access the Filter value from the Chart Web Part or from the Query Filter Web Part. – Hank Feb 12 '13 at 16:39
  • Oh sorry I thought that's what the Query String Filter Web Part is all about.. if I find something else I'll make sure to post again! – joweiser Feb 12 '13 at 23:26
  • Maybe this is what you looking for? Asked that this week: sharepoint.stackexchange.com/questions/59366/… – joweiser Feb 13 '13 at 15:47
  • You can use jquery to find the value: Open firefox+firebug, rightclick/inspect element with firebug. Then $('#id').val – XristosK Sep 14 '14 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.