Loading ...
Sorry, an error occurred while loading the content.

Re: removeTab

Expand Messages
  • gunsuka.diamonds
    Thanks Eric, I found the following code works: tabView.removeTab(tabView.getTab(1)); If I have three tabs (0,1,2) and I remove tab 1 does tab 2 become tab 1?
    Message 1 of 4 , Apr 29, 2009
    • 0 Attachment
      Thanks Eric,

      I found the following code works:

      tabView.removeTab(tabView.getTab(1));

      If I have three tabs (0,1,2) and I remove tab 1 does tab 2 become tab 1? I've not tried, but I suspect that would be the case.

      Can you do it by the item's ID name rather than an index number?



      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
      >
      > Rob,
      >
      > removeTab takes as its argument the Tab reference, not the Tab's index:
      >
      > http://developer.yahoo.com/yui/docs/YAHOO.widget.TabView.html#method_removeTab
      >
      > If you do tabView.removeTab(tabView.getTab(1)) that may solve your
      > problem (getTab returns the Tab instance based on the index).
      >
      > Regards,
      > Eric
      >
      >
      > On Apr 29, 2009, at 7:05 AM, Rob Gunther wrote:
      >
      > >
      > >
      > > I'm having troubles with removeTab in 2.7. It is the first time
      > > I've tried it actually.
      > >
      > >
      > > I can do something like this fine:
      > >
      > > tabView.selectTab(1);
      > >
      > > The tab would be selected.
      > >
      > > But if I try this:
      > >
      > > tabView.removeTab(1);
      > >
      > > It crashes. The error while in firefox debug is:
      > >
      > > M.get is not a function
      > >
      > >
      > > Is my syntax wrong or is it something else?
      > >
      > >
      >
    • Eric Miraglia
      Rob, removeTab always requires a Tab instance; getTab always requires the index value. AFAIK, there is no public method for accessing a Tab based on the HTML
      Message 2 of 4 , Apr 30, 2009
      • 0 Attachment
        Rob,

        removeTab always requires a Tab instance; getTab always requires the index value.  AFAIK, there is no public method for accessing a Tab based on the HTML id attribute.

        Regards,
        Eric


        On Apr 29, 2009, at 8:44 PM, gunsuka.diamonds wrote:

        Thanks Eric,

        I found the following code works:

        tabView.removeTab( tabView.getTab( 1));

        If I have three tabs (0,1,2) and I remove tab 1 does tab 2 become tab 1? I've not tried, but I suspect that would be the case.

        Can you do it by the item's ID name rather than an index number?

        --- In ydn-javascript@ yahoogroups. com, Eric Miraglia <miraglia@.. .> wrote:
        >
        > Rob,
        >
        > removeTab takes as its argument the Tab reference, not the Tab's index:
        >
        > http://developer. yahoo.com/ yui/docs/ YAHOO.widget. TabView.html# method_removeTab
        >
        > If you do tabView.removeTab( tabView.getTab( 1)) that may solve your
        > problem (getTab returns the Tab instance based on the index).
        >
        > Regards,
        > Eric
        >
        >
        > On Apr 29, 2009, at 7:05 AM, Rob Gunther wrote:
        >
        > >
        > >
        > > I'm having troubles with removeTab in 2.7. It is the first time
        > > I've tried it actually.
        > >
        > >
        > > I can do something like this fine:
        > >
        > > tabView.selectTab( 1);
        > >
        > > The tab would be selected.
        > >
        > > But if I try this:
        > >
        > > tabView.removeTab( 1);
        > >
        > > It crashes. The error while in firefox debug is:
        > >
        > > M.get is not a function
        > >
        > >
        > > Is my syntax wrong or is it something else?
        > >
        > >
        >


      Your message has been successfully submitted and would be delivered to recipients shortly.