Position the webpage to a specified pixel position in Gadget
-
Thursday, August 16, 2012 12:38 PM
Hi,
I'm using Windows 7 Enterprise edition.
I just created a gadget which has a SSRS report chart integrated in it. But the report chart is not visible in the gadget until I scroll to the point where the chart is present.
I need to show the report chart as and when I install the gadget i.e. my web page has a chart in the middle of the page. I need to display this report in the gadget small screen without scrolling to the middle. Directly, the gadget should adjust to the middle of the web page.
How can I do this?
Please help me in this regard.
Regards,
djandy
All Replies
-
Thursday, August 16, 2012 3:07 PMAre you using an iframe to display the web page in the gadget ?
-
Thursday, August 16, 2012 11:28 PMIf not, ie you mean the gadget html has a chart in the middle, you should try using the scrollIntoView method in your onload function :
eg
myChart.scrollIntoView(true);
- Edited by mystifeid Thursday, August 16, 2012 11:35 PM
-
Friday, August 17, 2012 6:17 AM
Hi,
Yes, I'm using iFrame to display the webpage. I found it difficult to move to that position, so placed the chart in the left top corner of the page and now it is fine.
But I have another prpoblem. I have a refresh page login for every 5 seconds and when the gadget page is refreshed, i gave
function DoInit(timeoutPeriod) {
document.body.style.width = 240;
document.body.style.height =360;setTimeout("location.reload(true);", timeoutPeriod);
Also I have resize logic i.e. dock and undock. Dock and undock are working fine but after 5 seconds when the page refreshes, again the size of the gadget is rest as given above.
It should not happen in this way. If the gadget is in smaller size, it should refresh and stay small. If the gadget is in larger size, it should refresh and stay large.
Any help please !!
Regards,
djandy
-
Friday, August 17, 2012 7:15 AM
Hi,
Thanks for your replies. I made the changes to the code and it is working fine now.
Below are the changes that I've made.
//document.body.style.width = 240;
//document.body.style.height =360;
System.Gadget.onDock = resizeGadget;
System.Gadget.onUndock = resizeGadget;resizeGadget();
Commented the width and height code and called the resizeGadget() function instead which fixed the issue.
Regards,
djandy
- Marked As Answer by d jandy Friday, August 17, 2012 7:15 AM


