4 Replies Latest reply on Aug 18, 2009 5:17 AM by shiftonyou

    sort dataGrid

    shiftonyou

      Hi,
      Is there a way to define how the dataGrid is sorted... or is there any similar component available?
      Actually the component sorts like this:
      1 2 3
      4 5 6
      7 8 9
      and i would like something like that:
      1 4 7
      2 5 8
      3 6 9

      Maybe i'm using the wrong component but i cant find any ohter that fits :(
      I'm looking at the source code of the renderers but i think it would take a long time for me to do it myself so i beter ask if it is'nt present already ;)

      Thanks!

      Cheers,
      Shifty

        • 1. Re: sort dataGrid
          ilya_shaikovsky

          You should just define the items in the model in needed order. Datagrid designed fully similar to standard h:panelGrid but iterating the model. So it's outputs the data in given order placing in defined number of columns.

          • 2. Re: sort dataGrid
            shiftonyou

            Thank you for your answer.

            Isn't there an other way then define all the items new... thats kind of expensive.

            I found something in the h:selectManyCheckbox -> layout="pageDirection" that would be great with the dataGrid...

            • 3. Re: sort dataGrid
              ilya_shaikovsky

              use just the base component - a4j:repeat. You will be able to create any markup based on iteration data.

              • 4. Re: sort dataGrid
                shiftonyou

                well, that would be a possibility but i don't know how to use this with multiple columns ... do you have any suggestion for me?