Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Create a menu that can be hidden

Hello

I got a qvw document in which I need to create a menu that can be hidden

I'm trying to add a container with grid style and add to it sheet objects representing menu items

I added a button so as to hide this container menu using the following macro:

set obj=ActiveDocument.GetSheetObject("CT06")

set sh = ActiveDocument.ActiveSheet

dim dummy(0)  'dummy array indicates all parts of frame to be set

    set fr = obj.GetFrameDef

    set pos = fr.Rect

   pos.Width = 0

    pos.Height = pos.Height

    obj.SetFrame fr,true,dummy

however when I click the button I get an error on the red line above

Please advise

I can walk on water when it freezes
2 Replies
hps
Employee
Employee

Hi,

The easiest thing would be to use a variable for the object/sheet you want hidden combined with a show condition.

Example:

vHidden = '1'; //Hidden

Then set the show condition for the container in your case to be if(vHidden='0')

And finally have the button toggle the value between 1 and 0

Regards,

Hampus

Not applicable

i think that i will be easyer to not use macro here...

i usually use simple click action:

the click action activates a variable that get '1' or '0' - somthing like " if (<variable name> = 1 ,0,1)

than for your container that holds the menu, in properties - layout, switch the show to conditional and set it to <variable name>=1

the result will be that with a simple click you can make the menu to apear or disapear.