5 Replies Latest reply on Mar 1, 2011 3:00 PM by kevinklin

    How to remove the use of virtual layout on a Spark DataGrid

    Jorge Raimundo Level 2

      Hi!

       

      I have the following spark data grid:

       

      <s:DataGrid id="listagem"
                  x="6"
                  y="6"
                  width="640"
                  height="400"
                  skinClass="skins.dataGrid.ConsusListagemDataGridSkin"
                  dataProvider="{imoveis}">
           <s:columns>
                <s:ArrayList>
                     <s:GridColumn headerText="IMÓVEL"
                                   itemRenderer="components.itemRenderers.ListagemImovelItemRenderer"/>
                     <s:GridColumn headerText="LOCALIZAÇÃO"
                                   dataField="comuna"
                                   width="130"/>
                     <s:GridColumn headerText="PREÇO"
                                   labelFunction="{function (item:Object, column:GridColumn):String {return '$ '+item.preco;}}"
                                   width="90"/>
                     <s:GridColumn headerText="COMPARAR"
                                   width="70">
                          <s:itemRenderer>
                               <fx:Component>
                                    <s:GridItemRenderer>
                                         <s:CheckBox verticalCenter="0" horizontalCenter="0"/>
                                    </s:GridItemRenderer>
                               </fx:Component>
                          </s:itemRenderer>
                     </s:GridColumn>
                </s:ArrayList>
           </s:columns>
      </s:DataGrid>

       

      My problem is that, if I select the check box on one item having a considerable amount of rows, then if I scrool down another item will appear checked even if I never clicked it.

       

      This is due to the use of virtual layout by the spark data grid, but I just can't find where to tell the data grid to not use virtual layout.

       

      Can anyone help me, please?

       

      Thanks,

      Jorge