Skip to main content
Known Participant
September 12, 2009
Question

Close a Tab

  • September 12, 2009
  • 2 replies
  • 1485 views

Is there a way to close a tab with a link or a button similar to the ColdFusion.createTab? I have looked through for the last couple of hours but don't seem to find a way

ISM

    This topic has been closed for replies.

    2 replies

    Participant
    September 13, 2009

    does it work with all versions? Doesn't work with mine..

    *************

    If you want to climb a mountain, it's not the mountain you should worry about, but the small stone in your shoe!

    http://www.enthaarung-intimbereich.de

    ismAuthor
    Known Participant
    September 13, 2009

    Thanks for the reply.

    I don't want to hide the tab but rather destroy it. I have ended up doing it this way and it works fine. Not sure why Adobe didn't create a function that closes the tab. I took me hours to find the underlying EXTJS function.

        <script type="text/javascript">
            closeTab = function(tabName){
                // get the underlying EXT object for the tab layout
                var tabs = ColdFusion.Layout.getTabLayout('myTabs');
                // get the tab you want to close
                var tab = tabs.getTab(tabName).id;
       alert(ColdFusion.Layout.getTabLayout('myTabs').removeTab(tabName))
      
            }
            closeNow = function(){
            closeTab('tab2')
            }
        </script>

    <input type="button" onclick="closeNow()" value="close tab">

    I wish they make things as easy.

    ISM

    Inspiring
    September 13, 2009

    I don't want to hide the tab but rather destroy it. I have ended up doing it this way and it works fine. Not sure why Adobe didn't create a function that closes the tab.

    Good point.  It's probably worth raising an enhancement request for that.

    http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

    --

    Adam

    BKBK
    Community Expert
    Community Expert
    September 13, 2009

    ColdFusion.Layout.hideTab

    For more details, see the list of AJAX JavaScript Functions in Coldfusion