Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Munz
Employee
Employee

Center Align Document Extension

I've often heard requests for an extension that can center align a QlikView document, and I recently built one for the Global Games app.

One difference between that one and the one I'm posting here, is that that version also places a new background image on the page.

So, non-technically, this extension will take your app and align it to the center of the window, including the tabs.  It also centers any background image on the app as well, so if you have a background image that is wider than the content area of the app, it could cause that background image to look strange.

A little more technically...since QV uses all absolutely positioned elements, it's difficult to determine the width of the content area, but I was able to do that in this extension in order to center it.  The one issue is that if there is a smaller width the content area, it will center based on that small area and look strange.  So, the default width that it sets the document to is 1024 pixels.  If the extension determines the app is wider, it will center properly for that width.

Even more technically...all the extension is really doing is wrapping the content area (the PageContainer div) inside a div with a class of "master."  Then, the extension just determines the content area width, and centers that content in the master div.

ANYway, hopefully this helps some people out.  I haven't tested in QVS yet, but it should work in QVS also.

Thanks.

EDIT: I modified the extension I originally posted to ensure the aligning updates when switching between sheets of different widths.

26 Replies
TKendrick20
Partner - Specialist
Partner - Specialist

Any reason this extension won't stay active? I move centerAlign into the Active Extensions area, hit Apply and OK, but once I switch into WebView nothing is centered and when I go back to the Extensions tab under Document Properties and the extension has moved back into Installed Extensions. Any ideas?

Not applicable

Love the extension, thanks for sharing!!

Not applicable

Tim,

Did you ever manage to solve that problem? Tried renaming the function etc but I am finding once applying this extension with other extensions it automatically disables.

Brian Munz

Brian_Munz
Employee
Employee
Author

I realize this is 6 months old, and I apologize, but I'm wondering if this was ever fixed.  I noticed that this extension could have problems playing nice with other document extensions.

Not applicable

I've tried modifying the code, re-writing it and the issue still remains. Are you allowed to call the SetOnUpdateComplete function more than once?

Brian_Munz
Employee
Employee
Author

I had thought so...

When you run the centerAlign by itself (with no other doc extensions), it works, right?

Not applicable

Yup, as soon as I assign another extension to the list centreAlign removes itself.