Flex datagrid hangs while fetching data

I have a datagrid that grows in size depending on the result of a call to my db. The database call returns an object with 30+ values ​​for each row. When the number of rows returned exceeds approximately 80-90, the datagrid is odd. It displays the first 50-60 rows ok, but then it displays blank rows and they even continue to display outside the datagrid border.

Does anyone know what's going on? Im using mxml webservice to fetch data.

<mx:DataGrid dataProvider="{resultsData}" rowCount="{resultsData.length}" allowDragSelection="false" 
    id = "confRoomLookupResults" width="948" 
    variableRowHeight="true" draggableColumns="false" wordWrap="true" resizableColumns="false"  
    borderColor="#E0E3E5" borderStyle="inset" x="10" top="35"

      

0


a source to share


3 answers


There is a 2880px limit for Flash movie size ( http://kb2.adobe.com/cps/144/tn_14437.html ). It is possible that your data grid exceeds these limits and is causing a render error. Are there exceptions?



Anyway, I would go with JustFoo's suggestion and just use the scrollbar. This makes sense since flash will only have to display what is visible, which will be a big performance boost for the client.

+1


a source


Is there a specific reason why you want the row count to be set as the length of the returned data?

What if you just try to set the datagrid height to 100% this will fill the viewport with the datagrid and any row overflow will result in a vertical scrollbar.



Hope it helps.

+2


a source


It looks like there are two problems:

1) rowCount is outside the rendered area of ​​the datagrid's visible area.

2) It seems that you are using Array not a custom object, so changes to the array such as length won't be obvious ...

From the Adobe website: http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_2.html

If you use a raw data object such as Array as your control data provider, Flex automatically wraps the object in a collection wrapper. The control does not automatically detect changes made directly to the original object. For example, changing the length of an array does not update the control. However, you can use an object proxy, listener interface, or itemUpdated property to notify an opinion of some changes.

0


a source







All Articles