Topic Progress:
  1. Add a URL button to your dashboard
  2. Give the button the URL of “**DOCUMENT**”  this is a placeholder so we can find it in the code later
  3. dCode the dashboard
  4. Place the word document in the root of the dashboard (ie in the same place as the app.html file)  In my example I will use the document called test.docx
  5. Open up the javascript file called components_1.js found in the gen_GUIDfolder
  6. paste the following code at the very top of that file
    function replaceAll(str,find,replace){return str.replace(new RegExp(find,'g'),replace);}
    var split=window.location.href.split('/');var pop=split.pop();var joined=split.join();var url=replaceAll(joined,',','/');
  7. Search through the rest of the file for the placeholder “**DOCUMENT**”
  8. replace the placeholder (including the ” ) with
    url+"/test.docx"

    Change the file name as appropriate

  9. In my example the code now looks like this:
    rt.setProperty(_xg_c,"url",url+"/test.docx")
  10. Now when you click on the URL button it will open / download the word document

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>