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

Re: Inherit from TabView

Expand Messages
  • Ted Husted
    Aside from Java-style inheritance, another approach is to use a power constructor . Setup a function that instantiates the TabView and then augments and
    Message 1 of 4 , May 30, 2007
    • 0 Attachment
      Aside from Java-style inheritance, another approach is to use a "power
      constructor". Setup a function that instantiates the TabView and then
      augments and configures it in whatever way you like, and returns the
      result. Such a function looks and feels like a "constructor", but "new
      " is optional.

      YAHOO.namespace("my");

      YAHOO.my.TabView = function(el, attr) {
      var oSelf = new YAHOO.widget.TabView(el,attr);

      // register new options and add tabs

      return oSelf;
      }

      ... elsewhere

      var oTabView = new YAHOO.my.TabView ("elTabView");

      HTH, Ted.
      http://yazaar.org/

      --- In ydn-javascript@yahoogroups.com, "mads_randstoft"
      <mads.randstoft@...> wrote:
      >
      > Well... the first problem is that TabView does not resemble the way
      > that Panel work.
      >
      > First of all there is no init call, so I donĀ“t know where to do my
      > work, like register new Options and adding the tabs I want in my gadget.
      >
      > What I want is a custom widget, that have some predefined tabs
      > (specified in constructor) and execute some code whenever the user
      > change the current tab, and ofcause (Which works fine) execute a
      > custom event at some points specified by me.
      >
      > The code is closed unfortunatly (So says the big boss here) so I can't
      > give it out to you here.
      >
      > If I could get some hinters as to how to create a tabview extended
      > with some default tabs (no more will be added) I would be much
      greatfull.
      >
      > --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@> wrote:
      > >
      > > mads_ranstoft,
      > >
      > > We don't currently have an example that extends TabView. You may
      > > want to post a link to your example, though, and specific pointers
      to
      > > the file where you're executing YAHOO.extend().
      > >
      > > Regards,
      > > Eric
      > >
      > >
      > > ______________________________________________
      > > Eric Miraglia
      > > Yahoo! User Interface Library
      > >
      > >
      > >
      > > On May 29, 2007, at 7:51 AM, mads_randstoft wrote:
      > >
      > > > I am making a widget that itself is build around a tab view (3 views
      > > > and controls for the same data)
      > > >
      > > > I have tried to make a new TabView extended (via YAHOO.lang.extend)
      > > > and in the init method adding the 3 new tabs to this.
      > > >
      > > > Nothing shows however when I appendTo(document.body); and I also
      need
      > > > to have some code run for the current tab when rendering (but can't
      > > > find any way to do that)
      > > >
      > > > Is there some example to extend a tabview (like the example to
      extend
      > > > the panel to a photobox)...
      > > >
      > > >
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.