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

TREE & DATATABLE

Expand Messages
  • malutanpetronel
    var callback = { success: function(oResponse) { for (var i=0, j=oResults.ResultSet ... var myDataTable = new YAHOO.widget.DataTable( testdiv , myColumnDefs,
    Message 1 of 5 , May 3 12:06 AM
    • 0 Attachment
      var callback = {
      success: function(oResponse) {

      for (var i=0, j=oResults.ResultSet
      ...
      var myDataTable = new YAHOO.widget.DataTable("testdiv", myColumnDefs,
      myDataSource);

      var myobj = { label: myDataTable, id:oResults.ResultSet.Result[i] } ;

      var tempNode = new YAHOO.widget.TextNode(myobj, node, false);
      ....

      and what I get is

      ROOT
      .
      ... + DataTable instance yui-dt1
      .
      ... + DataTable instance yui-dt2

      how can / should i transform that in "real" Datatable displaying ? ...

      probably I will have also to adapt the testdiv
      to "ygtv"+node.data.index or so ?

      Please contribute to my thoughts....
      Thank you
    • Satyam
      The label property is meant to contain a string so what JavaScript is doing internally is calling method toString() which all objects inherit from Object and
      Message 2 of 5 , May 3 12:45 AM
      • 0 Attachment
        The label property is meant to contain a string so what JavaScript is doing
        internally is calling method toString() which all objects inherit from
        Object and is redefined by all YUI components to give a brief descriptions
        of themselves.

        What you would need to do is to create HTMLNodes instead of textNodes and
        into each, you put a div with an id. Then you create the DataTable and give
        it the id of the div you put into the HTMLNode. I guess you could skip that
        last div and load your HTMLNode with nothing and use the id of the empty
        HTMLNode for the first argument of the DataTable constructor or better yet,
        use method getContentEl() of HTMLNode which will give you the HTML element
        directly, no need to bother with Ids at all.

        Satyam

        ----- Original Message -----
        From: "malutanpetronel" <malutanpetronel@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Saturday, May 03, 2008 9:06 AM
        Subject: [ydn-javascript] TREE & DATATABLE


        > var callback = {
        > success: function(oResponse) {
        >
        > for (var i=0, j=oResults.ResultSet
        > ...
        > var myDataTable = new YAHOO.widget.DataTable("testdiv", myColumnDefs,
        > myDataSource);
        >
        > var myobj = { label: myDataTable, id:oResults.ResultSet.Result[i] } ;
        >
        > var tempNode = new YAHOO.widget.TextNode(myobj, node, false);
        > ....
        >
        > and what I get is
        >
        > ROOT
        > .
        > ... + DataTable instance yui-dt1
        > .
        > ... + DataTable instance yui-dt2
        >
        > how can / should i transform that in "real" Datatable displaying ? ...
        >
        > probably I will have also to adapt the testdiv
        > to "ygtv"+node.data.index or so ?
        >
        > Please contribute to my thoughts....
        > Thank you
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG.
        > Version: 7.5.524 / Virus Database: 269.23.8/1412 - Release Date:
        > 02/05/2008 16:34
        >
        >
      • malutanpetronel
        Satyam thank you for your time explaining... Jut to let you know: In the mean time I ve modified my Tree node creation to: var tempNode = new
        Message 3 of 5 , May 3 7:55 PM
        • 0 Attachment
          Satyam thank you for your time explaining...
          Jut to let you know: In the mean time I've modified my Tree node
          creation to: var tempNode = new YAHOO.widget.TaskNode(myobj, node,
          false); where tasknode is the subclass as described in the checkbix
          example...
          In that tasknode subclass I've added : sb[sb.length] = '<div
          id="myDataTable' + this.index + '">' + this.index + '</div>'; to
          create the div for table and in my dynamic part for loading tree
          nodes I've did

          var myDataTable = new YAHOO.widget.DataTable("myDataTable" +
          (node.index+i), myColumnDefs, myDataSource);
          alert("myDataTable" + (node.index+i+1));

          I am close but still have the symptoms bellow:
          When I run the php file I see for example in firefox - > Inspect ...
          that the div myDataTable2 is it corectly created after node with
          index2 and myDataTable3 will be also created with the node index3...
          but the table isn't really created... No errors displayed but if I
          navigate deeper it looks that I get some DataTable to previous level
          nodes... It looks like the DataTables are generated but is a need to
          get a "REFRESH" to have themdisplayed... the "REFRESH" is produced by
          clicking in the tree again... or just than the DataTable is it
          generated for previous nodes...

          --- In ydn-javascript@yahoogroups.com, "Satyam" <satyam@...> wrote:
          >
          > The label property is meant to contain a string so what JavaScript
          is doing
          > internally is calling method toString() which all objects inherit
          from
          > Object and is redefined by all YUI components to give a brief
          descriptions
          > of themselves.
          >
          > What you would need to do is to create HTMLNodes instead of
          textNodes and
          > into each, you put a div with an id. Then you create the DataTable
          and give
          > it the id of the div you put into the HTMLNode. I guess you could
          skip that
          > last div and load your HTMLNode with nothing and use the id of the
          empty
          > HTMLNode for the first argument of the DataTable constructor or
          better yet,
          > use method getContentEl() of HTMLNode which will give you the HTML
          element
          > directly, no need to bother with Ids at all.
          >
          > Satyam
          >
          > ----- Original Message -----
          > From: "malutanpetronel" <malutanpetronel@...>
          > To: <ydn-javascript@yahoogroups.com>
          > Sent: Saturday, May 03, 2008 9:06 AM
          > Subject: [ydn-javascript] TREE & DATATABLE
          >
          >
          > > var callback = {
          > > success: function(oResponse) {
          > >
          > > for (var i=0, j=oResults.ResultSet
          > > ...
          > > var myDataTable = new YAHOO.widget.DataTable("testdiv",
          myColumnDefs,
          > > myDataSource);
          > >
          > > var myobj = { label: myDataTable, id:oResults.ResultSet.Result
          [i] } ;
          > >
          > > var tempNode = new YAHOO.widget.TextNode(myobj, node, false);
          > > ....
          > >
          > > and what I get is
          > >
          > > ROOT
          > > .
          > > ... + DataTable instance yui-dt1
          > > .
          > > ... + DataTable instance yui-dt2
          > >
          > > how can / should i transform that in "real" Datatable
          displaying ? ...
          > >
          > > probably I will have also to adapt the testdiv
          > > to "ygtv"+node.data.index or so ?
          > >
          > > Please contribute to my thoughts....
          > > Thank you
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > > --
          > > No virus found in this incoming message.
          > > Checked by AVG.
          > > Version: 7.5.524 / Virus Database: 269.23.8/1412 - Release Date:
          > > 02/05/2008 16:34
          > >
          > >
          >
        • malutanpetronel
          and Satyam if I do in taskNode sb[sb.length] = new YAHOO.widget.DataTable( myDataTable + this.index, myColumnDefs, myDataSource); than I get in each leaf a :
          Message 4 of 5 , May 3 9:02 PM
          • 0 Attachment
            and Satyam if I do in taskNode

            sb[sb.length] = new YAHOO.widget.DataTable("myDataTable" + this.index,
            myColumnDefs, myDataSource); than I get in each leaf a :
            ... + NODENAME1 ... DataTable instance yui-dt1
            ..
            ... + NODENAME2 ... DataTable instance yui-dt1
          • Satyam
            See: http://satyam.com.ar/yui/2.5.0/TreeAndTable.html Satyam ... From: malutanpetronel To: Sent:
            Message 5 of 5 , May 4 3:27 AM
            • 0 Attachment
              See:

              http://satyam.com.ar/yui/2.5.0/TreeAndTable.html

              Satyam

              ----- Original Message -----
              From: "malutanpetronel" <malutanpetronel@...>
              To: <ydn-javascript@yahoogroups.com>
              Sent: Sunday, May 04, 2008 6:02 AM
              Subject: [ydn-javascript] Re: TREE & DATATABLE


              > and Satyam if I do in taskNode
              >
              > sb[sb.length] = new YAHOO.widget.DataTable("myDataTable" + this.index,
              > myColumnDefs, myDataSource); than I get in each leaf a :
              > ... + NODENAME1 ... DataTable instance yui-dt1
              > ..
              > ... + NODENAME2 ... DataTable instance yui-dt1
              >
              >
              >
              > ------------------------------------
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              > --
              > No virus found in this incoming message.
              > Checked by AVG.
              > Version: 7.5.524 / Virus Database: 269.23.8/1412 - Release Date:
              > 02/05/2008 16:34
              >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.