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

Grouping in grid

Expand Messages
  • test_addon
    Hi, is there an example how grouping could be achieved. I would especially interested to see how it is possible to print a grid where the columns have group
    Message 1 of 3 , May 7, 2010
    • 0 Attachment
      Hi,

      is there an example how grouping could be achieved. I would especially interested to see how it is possible to print a grid where the columns have group header. I've found an example how to print a taffyDB in a simple grid as html table but I would be interested if there are also smart ways to get the grouping done, something like.

      Date1Date2
      Country1Country2Country1
      City1City2City3City1
      Travel X1
      Travel X2
      Travel X3

      Assuming the TaffyDB would look like this

      [
      {tripID:'Travel X1',date:'Date1',city:'City1',country:'Country1',value:400},
      {tripID:'Travel X1',date:'Date2',city:'City1',country:'Country1',value:800},
      {tripID:'Travel X2',date:'Date1',city:'City1',country:'Country1',value:450},
      {tripID:'Travel X1',date:'Date1',city:'City2',country:'Country1',value:300}
      ]


      The taffydb website is down, so I can't get into the tutorials.

      Greetings
    • tacoman_cool
      Thanks for the heads up on the site. The server it is on keeps crashing so I m planning to move to a new server this week. As for your question, the data grid
      Message 2 of 3 , May 10, 2010
      • 0 Attachment
        Thanks for the heads up on the site. The server it is on keeps crashing so I'm planning to move to a new server this week.

        As for your question, the data grid isn't officially supported. Since the data grid is so generic I'd recommend building something to render your custom table using your data.

        For example you could loop to get your tripIDs and then for each travel ID start adding cells with the details. When you are done you can add the correct number of column headers. I assume you are trying to make it dynamic so any given trip could have unlimited cities, correct?

        --- In taffydb@yahoogroups.com, test_addon <no_reply@...> wrote:
        >
        > Hi,
        >
        > is there an example how grouping could be achieved. I would especially
        > interested to see how it is possible to print a grid where the columns
        > have group header. I've found an example how to print a taffyDB in a
        > simple grid as html table but I would be interested if there are also
        > smart ways to get the grouping done, something like.
        >
        > Date1 Date2 Country1 Country2 Country1 City1 City2 City3
        > City1 Travel X1 Travel X2 Travel X3
        > Assuming the TaffyDB would look like this
        >
        > [
        > {tripID:'Travel
        > X1',date:'Date1',city:'City1',country:'Country1',value:400},
        > {tripID:'Travel
        > X1',date:'Date2',city:'City1',country:'Country1',value:800},
        > {tripID:'Travel
        > X2',date:'Date1',city:'City1',country:'Country1',value:450},
        > {tripID:'Travel
        > X1',date:'Date1',city:'City2',country:'Country1',value:300}
        > ]
        >
        >
        > The taffydb website is down, so I can't get into the tutorials.
        >
        > Greetings
        >
      • test_addon
        Yes, that is correct, it try to build a solution where I could define for both axis (column and rows) the columns in an collection. Then the function should
        Message 3 of 3 , May 10, 2010
        • 0 Attachment
          Yes, that is correct, it try to build a solution where I could define for both axis (column and rows) the columns in an collection. Then the function should draw the table. For example: an array for x-axis where first grouped by country, than by city ... and the y-axis by booking, date etc.. Ideal I think of a function to call like

          buildGrid (collection, rowSortedAxisArray,columnSortedAxisArray)

          buildGrid (collDB,{'country':'...','city':'...',...},{'booking':'..',date:'...',...})

          I'm using taffydb in an browser addon and so far it is really great and fast. Hope I get this solution done.

          Greetings


          --- In taffydb@yahoogroups.com, "tacoman_cool" <ian@...> wrote:
          >
          > Thanks for the heads up on the site. The server it is on keeps crashing so I'm planning to move to a new server this week.
          >
          > As for your question, the data grid isn't officially supported. Since the data grid is so generic I'd recommend building something to render your custom table using your data.
          >
          > For example you could loop to get your tripIDs and then for each travel ID start adding cells with the details. When you are done you can add the correct number of column headers. I assume you are trying to make it dynamic so any given trip could have unlimited cities, correct?
          >
          > --- In taffydb@yahoogroups.com, test_addon <no_reply@> wrote:
          > >
          > > Hi,
          > >
          > > is there an example how grouping could be achieved. I would especially
          > > interested to see how it is possible to print a grid where the columns
          > > have group header. I've found an example how to print a taffyDB in a
          > > simple grid as html table but I would be interested if there are also
          > > smart ways to get the grouping done, something like.
          > >
          > > Date1 Date2 Country1 Country2 Country1 City1 City2 City3
          > > City1 Travel X1 Travel X2 Travel X3
          > > Assuming the TaffyDB would look like this
          > >
          > > [
          > > {tripID:'Travel
          > > X1',date:'Date1',city:'City1',country:'Country1',value:400},
          > > {tripID:'Travel
          > > X1',date:'Date2',city:'City1',country:'Country1',value:800},
          > > {tripID:'Travel
          > > X2',date:'Date1',city:'City1',country:'Country1',value:450},
          > > {tripID:'Travel
          > > X1',date:'Date1',city:'City2',country:'Country1',value:300}
          > > ]
          > >
          > >
          > > The taffydb website is down, so I can't get into the tutorials.
          > >
          > > Greetings
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.