May 21, 2013, 11:27 PM
[CLOSED] Collapsing a tab panel when all tabs are hidden
Hi, Folks!
I have a tab panel that is collapsed on load. The tabs in the panel (there are several) are hidden on load.
I have a DirectEvent (we'll call it the Report) that changes the hidden value of the tabs to false and loads them with data (selectively; sometimes three tabs, sometimes 2, sometimes 1, etc.) when a button is clicked. This works great.
The tabs are closable, with closeaction set to hide. This works great.
I'd like to be able to collapse the panel when I close the last tab (whichever tab it is). I have a script (we'll call it the Close Script) that checks the hidden state of the tabs, and if all are hidden, it is supposed to collapse the panel.
I've tried firing that script from a Close listener, but it never fired; and from a Hide listener, but now it fires every time I close any tab, even if all the other tabs are still open; and also fires when the tabs are loaded/reloaded. Now, I imagine that this is because the "hidden" state is changed in the DirectEvent, and when the listener is fired, it's reading the state of the tabs when the page loaded.
If I use a DirectMethod for the Report instead of a DirectEvent, called via a JS function from a Listener on the button, and change the hidden state of the tabs in the JS function rather than in the DirectMethod, is the close script more likely to work?
Thanks!
Patrick
I have a tab panel that is collapsed on load. The tabs in the panel (there are several) are hidden on load.
I have a DirectEvent (we'll call it the Report) that changes the hidden value of the tabs to false and loads them with data (selectively; sometimes three tabs, sometimes 2, sometimes 1, etc.) when a button is clicked. This works great.
The tabs are closable, with closeaction set to hide. This works great.
I'd like to be able to collapse the panel when I close the last tab (whichever tab it is). I have a script (we'll call it the Close Script) that checks the hidden state of the tabs, and if all are hidden, it is supposed to collapse the panel.
I've tried firing that script from a Close listener, but it never fired; and from a Hide listener, but now it fires every time I close any tab, even if all the other tabs are still open; and also fires when the tabs are loaded/reloaded. Now, I imagine that this is because the "hidden" state is changed in the DirectEvent, and when the listener is fired, it's reading the state of the tabs when the page loaded.
If I use a DirectMethod for the Report instead of a DirectEvent, called via a JS function from a Listener on the button, and change the hidden state of the tabs in the JS function rather than in the DirectMethod, is the close script more likely to work?
Thanks!
Patrick
Last edited by Daniil; May 24, 2013 at 1:14 PM.
Reason: [CLOSED]