If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

jQuery and jquery plugin issues help!

Started by PlanningDev, 23 Sep 2014 10:04:28 PM

Previous topic - Next topic

PlanningDev

Im trying to implement jquery with the Fancy Box modal window plugin.  The plugin works fine until the report is reprompted.  Once reprompted its like the plugin and css aren't reloaded and I get an error stating that 

jQuery(...).fancybox is not a function.

I have tried the no conflict and referenced my code using jquery instead of $.  For whatever reason if I reprompt the report it drops the plugin and css links.

Is there anyway to make sure it retains the plugin on reprompt?
   

<script type="text/javascript">

               <link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5"/>
<script type="text/javascript" src="../fancyapps/lib/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="../fancyapps/source/jquery.fancybox.pack.js?v=2.1.5"></script>


jQuery.noConflict();

jQuery(document).ready(function() {

jQuery(".fancybox-iframe").fancybox({

//afterClose: function() {
//var oCR = cognos.Report.getReport("_THIS_");
//oCR.sendRequest(cognos.Report.Action.FINISH);
//},

autoScale : false,
autoCenter: true,
type: 'iframe',
height: 600,
width: 1200,
fitToView : false,
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',

helpers   : {
overlay : {closeClick: false} // prevents closing when clicking OUTSIDE fancybox
  }


});

});
</script>

PlanningDev

Turns out that instead of linking to the fancybox js file I just copied the contents of it into an html item in the report and now it works.  Cognos must do something weird with linked JS files.

hardstep

I would be very interested in hearing about how people use jquery with cognos - the integration of js and how cognos RS overrides content has always been a dark art !!!
Cheers
Nick