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

Re: YUI datatable with tree-like expansion of records

Expand Messages
  • HsiaoPing_YU
    Hi Satyam, Did you get the chance to finish the example http://satyam.com.ar/yui/2.6.0/TreeGrouping.html? I tried to use your sample code as base to add
    Message 1 of 9 , Feb 26 5:01 PM
    • 0 Attachment
      Hi Satyam,

      Did you get the chance to finish the example
      http://satyam.com.ar/yui/2.6.0/TreeGrouping.html? I tried to use
      your sample code as base to add column sort and other datatable
      features (drag & drop, resize etc). I found a few problems:

      1. after sort by any column, the tree nodes are out of order (I guess
      you example is not designed to work with sorting)
      2. when expanding a node by clicking on the + image, it actually
      expands the node next to (below) it.
      3. sometimes the random data has a depth 0 node containing depth 2
      nodes without a depth 1 node in between. It's minor, but thought you
      may like to know about it.

      I need trees within datatable which when sort, it sorts within each
      sub tree. For example:

      col1 col2 col3
      -----------------------------------------
      - inbox
      a1 x1
      b1 y2
      a2 y1
      - sent
      a1 x1
      b1 y2
      a2 y1

      when sorted by col2, it'll display the list in following order:
      col1 col2 col3
      -----------------------------------------
      - inbox
      a1 x1
      a2 y1
      b1 y2
      - sent
      a1 x1
      a2 y1
      b1 y2

      Can you give me some pointers or examples? Thanks a lot in advance!

      Jennifer
      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > I guess that you would use a function as I did but in your case it
      would
      > read that tree of yours and return the records like:
      >
      > Asia, India
      > Asia, China
      > Asia, Japan
      > Europe, UK
      > Europe, France
      > ... and so on. That is the kind of format DataSource expects.
      >
      > Satyam
      >
      >
      > shastrilavanya wrote:
      > > Hi Satyam,
      > >
      > > I find your example useful but I need a little help with setting
      the
      > > datatable's datasource.In your example you set the datasource
      using
      > >
      > > new YAHOO.util.FunctionDataSource(function() {
      > > ...
      > >
      > > How would I set the datasource to a javascript array for a table
      whose
      > > contents would be something like:
      > >
      > > Asia (parent)
      > > -->India (child)
      > > -->China (child)
      > > -->Japan (child)
      > >
      > > Europe (parent)
      > > -->UK (child)
      > > -->France (child)
      > >
      > > North America (Parent)
      > > -->USA (child)
      > > -->Canada (child)
      > >
      > > I know how to set the datasource for an ordinary datatable.But I
      am a
      > > confused about how to go about doing this for tree-like data.
      > >
      > > I am pretty new to YUI and JavaScript in general.Appreciate any
      help
      > > you can give me.Thanks in advance.
      > >
      > > Lavanya
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
      > >
      > >> I know this is not a good example, I've just began to work on it
      so it
      > >> is in no way finished, but you can try it:
      > >>
      > >> http://satyam.com.ar/yui/2.6.0/TreeGrouping.html
      > >>
      > >> Satyam
      > >>
      > >>
      > >> mariandsouza@ wrote:
      > >>
      > >>> Hi All,
      > >>>
      > >>> I am trying to get a TreeView inside a Datatable.I got the idea
      from
      > >>> Satyam's article:http://www.satyam.com.ar/yui/index.html(See
      under the
      > >>> heading 'external links' )
      > >>>
      > >>> My goal is to create something like
      > >>> this:http://extjs.com/deploy/dev/examples/tree/column-tree.html
      using
      > >>> yui components
      > >>>
      > >>> Let me give an example scenario:(just to provide some context)
      > >>>
      > >>> Say I have 'Recipe Sets'.Each Recipe Set contains
      many 'Recipes'.
      > >>> All the Recipes have common attributes
      > >>> like:Name,TimeCreated,LastModified etc
      > >>>
      > >>> In a tree view this would be something like:
      > >>> +RecipeSet1
      > >>> -RecipeSet2
      > >>> -myrecipe1
      > >>> -thisrecipe
      > >>> -thatrecipe
      > >>> +RecipeSet3
      > >>> standalone_recipe
      > >>>
      > >>> I would like to perform the following operations on the Tree
      > >>>
      > >>> *If I click the '+' the RecipeSet should expand to display the
      child
      > >>> 'Recipes'
      > >>>
      > >>> *I should be able to filter the table
      > >>> 1.First by RecipeSet
      > >>> 2.Then by Recipes within a particular recipe set
      > >>>
      > >>> *There can also be stand-alone recipes that are not associated
      with
      > >>> any RecipeSet
      > >>>
      > >>> *I should be able to select/deselect all the RecipeSets to
      perform
      > >>> batch operations like (Remove all RecipeSets)
      > >>>
      > >>> *If I select a RecipeSet then all the child recipes under it
      should
      > >>> automatically get selected.
      > >>>
      > >>> Checkboxes will be used for selection.
      > >>>
      > >>> Note:The RecipeSets also have certain attributes associated
      with them
      > >>> (These attributes are the same as the recipes)
      > >>>
      > >>> Looks like I have my work cut out for me :)
      > >>>
      > >>> I guess my basic problem is how to get a tree view and data
      table to
      > >>> work together.
      > >>>
      > >>> If anyone could tell me how to start or where to look for more
      > >>> information I would really appreciate it.I need all the help I
      can
      > >>>
      > > get.
      > >
      > >>> Thanks in advance.
      > >>>
      > >>> Marian D'Souza
      > >>>
      > >>>
      > >>>
      > >>>
      > >>>
      > >>>
      > >>>
      > >>>
      > >>> ------------------------------------
      > >>>
      > >>> Yahoo! Groups Links
      > >>>
      > >>>
      > >>>
      > >>>
      > >>>
      > > ------------------------------------------------------------------
      ------
      > >
      > >>> No virus found in this incoming message.
      > >>> Checked by AVG - http://www.avg.com
      > >>> Version: 8.0.176 / Virus Database: 270.10.0/1864 - Release Date:
      > >>>
      > > 25/12/2008 9:40
      > >
      > >>>
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > > ------------------------------------------------------------------
      ------
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - http://www.avg.com
      > > Version: 8.0.176 / Virus Database: 270.10.2/1873 - Release Date:
      03/01/2009 14:14
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.