3 Replies Latest reply on Jul 17, 2009 1:29 PM by The-Dude-Abides

    AdvancedDataGrid gets confused about selection


      I have an AdvancedDataGrid which has an XML data provider. I create a TitleWindow popup, and then refresh the XML data provider using a callback from the popup. Sometime the datagrid gets out-of-sync. When I drag the pointer over a certain row, the highlight shows up on a completely different row. Any ideas what mught be causing this? Has anyone run into this?

        • 1. Re: AdvancedDataGrid gets confused about selection
          *Prashant Shelke* Level 4

          Are you using any kind of itemrenderers in your dataGrid?

          • 2. Re: AdvancedDataGrid gets confused about selection
            EgorKDie Level 2

            Flex uses an internal GUID on the data items to determine the row highlighting, and it only uses the first one it finds.


            This is usually seen when data items are copied and put in the same list (you roll over the copy, and the original highlights).


            I'm not sure how the ADG handles XML (and I can't be bothered wading through the thousands of lines of code that makes it up) but I'd check your identifiers on your XML in the first instance.

            • 3. Re: AdvancedDataGrid gets confused about selection
              The-Dude-Abides Level 1

              This problem is difficult to reproduce. Some users easily reproduce it, I can not. My latest solution (only time will tell) is using callLater(). After I refresh the datagrid with a new XML document, I try to autoscroll to the previous location. I was setting the dataprovider and scrollposition in the same method. Now I set the scrollposition in a separate method scheduled using callLater(). It seems to have solved the problem.


              Any suggestion on good reading related to the callLater() method? When should it be used?






              My new issues is generating XML. I have a situation where I need to use a CDATA node in my document, but I am not sure how to detect this? Is there an API that allows me to add a Text node or CDATA node depending on whether a String contains XML characters such as '<' ?