Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Workbench - dyanmically resize QVObject as browser changes sizes?

Is it possible to resize Workbench QVObjects from javascript as the browser window changes sizes?

4 Replies
Brian_Munz
Employee
Employee

Sorry I didn't see this earlier but this is definitely possible.  Do you still need help?

If so, could you be more specific about what you're trying to do?

Not applicable
Author

Yes, could still use some help.

                    <qww:QvObject ID="QvObject3" runat="server"

                        QlikViewDocument="NetworkPerformance  (Local)"

                        QvAjaxZfcPath="http://jimsserver02/QvAjaxZfc/" BorderStyle="Solid"

                        ObjectID="CH04" ObjectType="Straight Table" Width="1000px"

                        Height="325px" />   

Want to be able to adjust the width & height of the QvObject client side from Javascript.

Thanks, Jim

Brian_Munz
Employee
Employee

It should be pretty easy to do if you get the ID of the created object (not the QvObjectID, the id of the div that is written out to the page which contains the object...it has a class of QvFrame), using javascript like:

var thisDiv = document.getElementById("The name of the ID");

Then change the height and width like this:

thisDiv.style.height="400px";

So if you wanted to get the width of the browser window (and you're not using jQuery or something), see this article for the best way to suit your needs:

http://www.javascripter.net/faq/browserw.htm

Once you have the height or width as a variable (for example browserHeight), just do:

thisDiv.style.height= browserHeight + "px";

Not applicable
Author

I can get the <DIV> then encloses the QvObject to resize but the chart/table is not redrawn to fit in the newly sized QvObject. There is a gray boarder with the new size but the chart/table image does not change. My current work around is to do a postback and set the width/height from C# codebehind. Would really like to figure out how to get the QvObject to redraw. Thanks.