4 Replies Latest reply on Feb 16, 2011 5:44 AM by eprevot123

    Updating dataprovider causes mess when scrolling in AdvancedDataGrid

    eprevot123 Level 2

      Hi

       

      I have a problem using AdvancedDataGrid :

      I bind the ADG dataprovider to a XML in my model, like this :

       

             <mx:AdvancedDataGrid
                  <mx:dataProvider>
                      <mx:HierarchicalCollectionView filterFunction="{model.filterFunction}" source="{hierarchicalData}"/>
                  </mx:dataProvider>
                  <mx:columns>   
                      <mx:AdvancedDataGridColumn labelFunction="{model.menuLabel}"/>
                   </mx:columns>
             </mx:AdvancedDataGrid>

       

          <fx:Declarations>
              <mx:HierarchicalData id="hierarchicalData" source="{model.myXML.xmlNode}"/>
          </fx:Declarations>

       

      When I start the application, the ADG displays poperly my model.

      Then I programmaticaly add a node to myXML in my model, the ADG renders it and adds a row. So far so good.

      Then when I scroll vertically in the ADG, some rows are added or removed, or the mouse highlighting jump to another line... Total mess.

       

      I read that this may be because ADG recycle renderers and so we have to override the "set data" function in renderer. But here I don't use renderer but labelFunction.

      And I don't have the problem when scrolling, until I change the dataprovider.

       

      Do you have an idea ?