on 07-28-2014 8:02 PM
How to make i5Chart clickable and opens up in a pop-up window?
Here is one chart code:
var i5Chart1 = new com.sap.xmii.chart.hchart.i5Chart("WVLMicrofiber7/Charts/WVLCharts", "WVLMicrofiber7/WebServices/WSWVL7TESTDATA");
i5Chart1.setChartWidth("540px");
i5Chart1.setChartHeight("250px");
var Query1= i5Chart1.getQueryObject();
Query1.setParameter("Param.1",Machine);
Query1.setParameter("Param.2","FREENES1");
i5Chart1.draw("1");
Hi Amr,
To make an element clickable you can use the below snippet (with jQuery):
$("#chart1").click(function() { window.open('http://www.google.com', '_blank'); });
where chart1 is the div id provided in i5Chart1.draw("chart1")
Best Regards,
Ria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ria,
Do I write the above snippet in a java script? Like:
<script>
$("#chart1").click(function() { window.open('http://www.google.com', '_blank'); });
</script>
Hi Amr,
You will have to place this code in the onload event of the page or a place where you are sure that the element already exists in the DOM.
For e.g,
function load() {
$("#div").click(function() {
alert("You clicked the i5Chart");
//window.open('http://www.google.com', '_blank');
});
}
<BODY onload='load();'>
<div id="div"/>
</BODY>
Hope this helps!
Best Regards,
Ria
Actually, it seems it can only work only for MII query - where you want to pass parameters to the URL to view the content.
I do not think it applies to the charts.......
The following did not work:
function load() {
$("#div1").click(function() {
alert("You clicked the i5Chart");
//window.open('http://www.google.com', '_blank');
});
}
<BODY onload='load();'>
<div id="1"/>
</BODY>
Hi Amr,
That code didn't work because the div id that you have used in load() is incorrect. Within div tag you have used "1" as the id and in load() you have used "div1". You can modify the div tag as shown below and it should work for you:
<div id="div1"/>
Further, I didn't get what you mean by "do not think it applies to the charts".
Best Regards,
Ria
User | Count |
---|---|
12 | |
6 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.