13 Replies Latest reply on Jul 9, 2009 4:08 AM by Eliezer Reis

    DataGrid add component between rows

    Eliezer Reis Level 1

      Hi,

       

      I'd like to know how can I add custom component between two rows (It need fill all row) of a DataGrid when I click . Is there something that I can do to take control of a entire row including its UIComponent? I know that DataGrid there is a columns array but its is there a row array?

       

      Why would I like those things? I wanna this because I'd like to do a expanded row like in restaurant finder (http://www.adobe.com/devnet/flex/samples/restaurant/) sample but can't use just repeater because there's implicit appliance on peformance.

       

      Thanks for help.

        • 1. Re: DataGrid add component between rows
          Flex harUI Adobe Employee

          Just make it so every column has a renderer that can expand.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: DataGrid add component between rows
            Eliezer Reis Level 1

            Yes, I had already thought of that. But there are some points that I still don't understand.
            - I would like to expand the column only if user apply a double click in a row. If I apply a itemRenderer this automatically will be applied when the Grid is rendered then the user will see all rows already expanded and He can't select what rows He want to see in detail.
            - I would like to arrange the items, when these expand completely, in a different sequence of the main columns. If I apply a ItemRenderer its will follow the height and width of the column then, How Can I add a itemrenderer that fill all columns? Its important because I need arrange datas in diferrent order of columns. Sometimes I will show a big text, for example, and this text will appear down of columns (between two rows) and fill the width of grid.
            - Is there a way to apply effects when expanding a row.


            Basically, I need that "row detail"  is independent of main row but use the same dataProvider and stay below of main row.

             

            Well, I don't know if is clear. I tried to explain better that I could. Are you understand what I need?

             

            Why I need use DataGrid for it? Because I think that this component was build to work with data and for this i think that has better performance.

             


            Thanks for help.

            • 3. Re: DataGrid add component between rows
              Eliezer Reis Level 1

              I think that if I show my code maybe you will understand better. I attach the DetailGrid file (this is application) and DetailItem (itemRenderer). When you run it, try to click in checkbox. You will see that row will expand but It'll fill just one column. I need that this itemRenderer fill all of my columns (fill complete a row).

               

              Can you give me any suggestion to do this?

               

              Thanks again.

               

              Message was edited by: Eliezer Reis

              I cant attach .mxml file then I change extensions to .txt.

              • 4. Re: DataGrid add component between rows
                Eliezer Reis Level 1

                Anyone has idea of how can I resolve this?

                • 5. Re: DataGrid add component between rows
                  Eliezer Reis Level 1

                  Please guys, Is there someone that have some sugestion for my problem?

                  • 6. Re: DataGrid add component between rows
                    Eliezer Reis Level 1

                    I not forgot this topic, I'll try to find a answer of it. Someday I'll fix this problem.


                    P.S. Sometimes I think that this forums there isn't support enough for users. I see more questions that answers.

                    • 8. Re: DataGrid add component between rows
                      Flex harUI Adobe Employee

                      Adobe was on holiday last week.  I’m catching up on emails and don't have time to review your code right now.

                       

                      If you want to show data other than data related to the column, it might confuse the user.  If you're sure you want to do that, try making the first column have a child that is as wide as you need it to be, and have other children show nothing in that area.

                       

                      Alex Harui

                      Flex SDK Developer

                      Adobe Systems Inc.

                      Blog: http://blogs.adobe.com/aharui

                      • 9. Re: DataGrid add component between rows
                        Eliezer Reis Level 1

                        Hi,

                         


                        First, thanks for your time.

                         

                        Well, indeed my wish is to be able to show extra informations to end user using something like a row template. Sometimes theses datas can be long (like a large text) that is better if it fill all visible area.

                         


                        Your suggestion isn't good because I need show data where I wanna in a canvas (related with position). If I do like you said, I'll lose space and user can see these stranger workaround.

                         


                        Well, I stop try this using DataGrid. DataGrid there isn't access of a row (too bad) just to columns then I changed to AdvancedDataGrid and I got a code like in the annex.  Now I have new doubts:

                         


                        - To expand a AdvancedDataGrid I have to use, necessarily, a HierachicalData that isn't good. I need to access all data, not only the children attribute of  a arraycollection. Actually, the collections that come from server doesn't have element "children". How can I Do to resolve it?

                         


                        - How could I create a HierarchicalData through a service LCDs. I could serialize this HierarchicalData?

                         


                        - How could I access all ArrayCollection? In my tests on item renderer i got access only of dataField property or children attribute of my HierarchicalData.

                         


                        I know that flex and silverlight are completely different. But what I wanted is exactly what is on the following link http://demos.devexpress.com/AgDataGridFreeDemos/ (Preview menu and RowTemplate). If you observe is not confusing for the User.

                         

                         

                        Tnks again.

                        • 11. Re: DataGrid add component between rows
                          Flex harUI Adobe Employee

                          I haven't done much work with AdvancedDG.

                           

                          I still think you can place stuff anywhere in an expanded area in a DG row, but it will take some work.

                           

                          Alex Harui

                          Flex SDK Developer

                          Adobe Systems Inc.

                          Blog: http://blogs.adobe.com/aharui

                          1 person found this helpful
                          • 12. Re: DataGrid add component between rows
                            oldMster Level 3

                            It seems to me the 'preview row' example is most like an accordian navigator.  You could subclass that and add a 'populate' function to process your data source to format each accordian panel.  Even if you want editing features, it seems to me to be a better starting point for what you want rather than the datagrid.

                            Mark

                            1 person found this helpful
                            • 13. Re: DataGrid add component between rows
                              Eliezer Reis Level 1

                              I really dont know how can I show multiples rows and columns using Accordian. But I'll test use Accordian with a renderer, maybe will be softer that use normal expand\collapse of ADG.


                              Well, thanks a lot guys. Now I can do a lot of nice things with ADG (I confess that I think that DataGrid had to be much better yet). My problems now is how to work properly with HierarchicalData and LCDS serializing in real time through the network.