Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to refer a Grid through scripting
pm.nayak84
Hi ,
I am using A HTML button as show/hide . Through the onclick a script function will be evoked which is going to handle the showing and hiding of a grid in the report content .
Scripting function is written on one of the text column as below . passing elementname as "mygrid" the bookmark property set for the grid .
its all working fine when output is viewed AS HTML output but show/hide property does not work when i am trying to view as Web viewer output .
<script>
var bToggleValue = true;
toggleGridVisibility("mygrid");
function toggleGridVisibility(elementname)
{
if (bToggleValue) {
document.getElementById(elementname).style.display="inline";
document.getElementById(elementname).style.visibility="visible";
document.mygrid.style.display="visible";
}
else {
document.getElementById(elementname).style.display="inline";
document.getElementById(elementname).style.visibility="hidden";
document.mygrid.style.display="hidden";
}
bToggleValue = !bToggleValue;
}
</script>
Find more posts tagged with
Comments
johnw
The DOM is slightly different through the web viewer as opposed to HTML. HTML gets output directly as HTML, so any Javascript will get loaded directly. Using the WebViewer, it gets put in as an innerHtml to a div tag, so the Javascript will be ignored.
johnw
Ill have to look for the example I have, but I have one that will work for both the web viewer and direct HTML output.
pm.nayak84
Thanks for the reply .
Please share something which can help in appropriate scripting for web view .
Thanks
Priya
johnw
I dont have the exmaple I'm thinking of offhand, but this one gives the general idea. Basically, instead of highlighting, but it works in both the viewer and the HTML output, so you can get an idea how to generate javascript.
johnw
http://digiassn.blogspot.com/2009/06/birt-highlight-chart-series-on.html