Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Adding functionality to Expanding group in view - jQuery

$
0
0

I have code on a page with multiple app web parts. Those that do not have collapsible views, the code works fine and as expected. Those that do have collapsible views (collapsed by default/expand by default not an option for this page) the code does not work. I've also tried .delegate and .on("click"... neither of which work either (getting "Object does not support .delegate/.on")

Can anyone point out where I'm wrong? I need to add target=_blank to all view links.

<script type="text/javascript">
function addTarget() {
var allIntLinks = $("table a");
allIntLinks.each(function() {
     $(this).attr("target", "_blank"); //THIS WORKS FINE FOR LINKS NOT IN COLL.VIEW
});
}
$(document).ready(function() {
     var defaultExpCollGroupMethod = ExpCollGroup;
     ExpCollGroup = function() {
          defaultExpCollGroupMethod.apply(this, arguments);
          setTimeout(addTarget,2000); //Also tried setTimeout(addTarget(),2000) with no luck
     };
     addTarget();
});</script>


- Thank you. Respectfully, Janette M. Ricker


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>