How to use JQuery in Presentation Mode (MicroStrategy 10)

Hello there,

I was really sad when I upgraded to MicroStrategy 10 and I wasn’t able to add JQuery to the dashboards anymore. But today I found a blog that found a way to do that!!

Here goes the URL:

http://www.relational.es/blog/en/microstrategy-10-hacks-loading-jquery-under-new-presentation-mode/

I was trying to add the jsPDF library to export the dashboard and it did work. The exportation was not good, but it least I could guarantee that this method really works!

What I did was to add an HTML Container and added these lines:

var script = document.createElement(“script”);
script.src=”http://yourjavascript.com/260113503242/jquery-1-7-1-min.js”;
document.getElementsByTagName(‘head’)[0].appendChild(script);

var script = document.createElement(“script”);
script.src=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js”;
document.getElementsByTagName(‘head’)[0].appendChild(script);

var script = document.createElement(“script”);
script.src=”http://yourjavascript.com/221021632534/jspdf-debug.js”;
document.getElementsByTagName(‘head’)[0].appendChild(script);

var script = document.createElement(“script”);
script.src=”http://yourjavascript.com/16067320515/bsa.js”;
document.getElementsByTagName(‘head’)[0].appendChild(script);

So, in order to import more than one javascript, you just have to copy and paste from var script… until appendChild(script); code!

 

Hope it helps!

God bless you!

5 Replies to “How to use JQuery in Presentation Mode (MicroStrategy 10)”

  1. Hi Felipe! First of all, thanks a lot for your blog, it’s very useful 🙂

    Related to jquery, I was wondering if it’s possible to add a jquery script in a MSTR page (with SDK) in order to put a collapsible section into the document’s page (something like http://www.bryanbrandow.com/2013/01/collapsible-sections-with-jquery.html but withouth editing any document, directly on RW_Content or the appropiate page). Have you achieved something like this? Thanks in advance.

    Regards,
    Elena.

    Like

  2. Hi Felipe! Thank you for your reply. My problem is that I can’t edit any document, I have to do this at template level. I can change the template (I have inserted a new section), next thing will be to import a custom library and do the query. Wish me luck!

    Like

      1. Hi Felipe!

        Do you think it’s possible to, once you have your document executed, use the connection you have to the metadata and make a query? I’m thinking about putting the code in the mojo_section.ascx (as I have put a section before the document is rendered). Thanks in advance!

        Regards,
        Elena.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s