5 Replies Latest reply on Jun 4, 2009 11:52 AM by bustareed

    Edit field in DataGrid headers

    p.jacobi

      I'm looking for a worked out example how to have edit fields in the headers of a data grid, above the normal content (name, sort arrow).

       

      An approach with a separate HBox of edit fields, which resize with columns would be fine, too.

       

       

      Regards,

      Peter

        • 1. Re: Edit field in DataGrid headers
          Flex harUI Adobe Employee

          What happens if you use TextInput as your DataGrid header renderer.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

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

          • 2. Re: Edit field in DataGrid headers
            p.jacobi Level 1

            If I just use TextInput as HeaderRenderer, I lose the the standard header. I don't want to replace the standard header (name and sort icon) but add to it. Or do I have to recreate this functionality, I hoped there was some kind of delegation/inheritance possible.

             

            (I should have stated my experience level with Flex: Nearly nil. Whereas I'm programming since the dark ages of punch cards, I just downloaded the Flex Builder Trial two weeks ago.)

            • 3. Re: Edit field in DataGrid headers
              Michael Borbor Level 4

              Just extend the DataGridHeader and add the fuctionality that you want

               

              Sincerely,

               

              Michael

               

              El 21/04/2009, a las 14:35, "p.jacobi" <forums@adobe.com> escribió:

               

              >

              If I just use TextInput as HeaderRenderer, I lose the the standard 

              header. I don't want to replace the standard header (name and sort 

              icon) but add to it. Or do I have to recreate this functionality, I 

              hoped there was some kind of delegation/inheritance possible.

              >

              (I should have stated my experience level with Flex: Nearly nil. 

              Whereas I'm programming since the dark ages of punch cards, I just 

              downloaded the Flex Builder Trial two weeks ago.)

              >

              • 4. Re: Edit field in DataGrid headers
                Flex harUI Adobe Employee

                When I set headerRenderer="mx.controls.TextInput" it showed the label of the column and shrunk to show the sort arrow.

                 

                If you want to see some other visual, you may have to create a custom renderer.

                 

                Alex Harui

                Flex SDK Developer

                Adobe Systems Inc.

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

                • 5. Re: Edit field in DataGrid headers
                  bustareed

                  Hi,

                   

                  I took a simple AdvancedDataGrid sample and set headerRenderer = "mx.controls.TextInput". I find that this causes the column labels to be displayed within the text input box correctly, but the sort arrows are no longer visible. Is there any other property or setting in the datagrid/advanceddatagrid that needs to be modified to make the sort arrows visible?


                  Regardless of arrow visibility, sort functionality itself appears to be working; ie clicking on the text input box toggles between ascending and descending sorting. However, the text input box loses focus immediately after it is clicked, making it impossible to enter text into it.

                   

                  Does anyone have suggestions on how one can maintain focus on the text input box?

                   

                  Thanks.