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

Re: [ydn-javascript] How to insert a tabview in another tabview ?

Expand Messages
  • Matt Sweeney
    Hi Agnes, It should be possible to do this. Are you getting a JS error when the process stops? Matt
    Message 1 of 2 , Dec 1, 2006
      Hi Agnes,

      It should be possible to do this.  Are you getting a JS error when the process stops?


      agnes.labbe wrote:
      I am trying to do that in javascript:
      My tabview is build with the data coming from an ajax response like:

      And i have these div tags in my html code:
      <div id='mainTabSet'>
          <div id='subTabSet'></div>

      And here my callback function:
      processResult: function processResult(request){
                   &nbs! p;  if (request.status == 200) {
                              var tabset = request.responseXML.getElementsByTagName("tabset")[0];
                              var id = tabset.childNodes[0].firstChild.nodeValue;
                              var label = tabset.childNodes[1].firstChild.nodeValue;

                              mainTabSet = new YAHOO.widget.TabView("maintabset");
                              var subTabPanel = new YAHOO.widget.TabView("tab"+id);
                      !         subTabPanel.set('orientation', ' bottom');
                              var tabs = request.responseXML.getElementsByTagName("tab");
                              if (tabs.length > 0) {
                                  for (var i=0; i< tabs.length; i++) {
                                      var tabName = tabs[i].childNodes[1].firstChild.nodeValue;
                                      alert("label: "+tabs[i].childNodes[0].firstChild.nodeValue);
                 !                      subTabPanel.addTab( new YAHOO.widget.Tab({
                                          label: tabs[i].childNodes[0].firstChild.nodeValue,
                                          content: "content"
                          &n! bsp;       }
           &nbs p;                  }
                              YAHOO.util.Event.onContentReady('mainTabSet', function() {
                              mainTabSet.addTab( new YAHOO.widget.Tab({
                                  label: label,
                              ! ;    content: subTabPanel,
                                  active: true
                              YAHOO.util.Event.onContentReady('tabSet', function() {
                                  mainTabSet.appendTo(this); /* append to #tabSet */
                                  alert("mainTabSet tab linked");
       &nb! sp;              }        }

      There is no bug during the xml process, but the process is stop when i try to add the tabview to the main tab view.
      So, it is possible to do that ?

      Thanks for the answers.

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