Flex creates all 100 checkbox instances for 100 records ...Infact when you specify the dataprovider for a DataGrid it will render and create instances
for all the items in your DataProvider...at the same time....but not for only the visible items..
If you take TileList control in Flex...it will create instances only for the visible items first and as you scroll by the instances for the next visible items
are created....Where in contrary to this ...in a Tile container used with a Repeater component creates all the insatnces at the same time...for visible and
invisible items as well....
Thanks for reply..
u mean it will create all 100 record in datagrid. Ok can u tell me about viewstack components also please?
@Flex4 ..Yes it will create all the 100 records in DataGrid...
Coming to ViewStack...the creation varies on the creationPolicy property of the ViewStack container...
Containers with multiple views, such as the ViewStack and Accordion, do not immediately create all of their descendants, but only those descendants that are visible in the initial view. Flex defers the instantiation of descendants that are not initially visible until the user navigates to a view that contains them. The following containers have multiple views and, so, are defined as navigator containers:
When you instantiate a navigator container, Flex creates all of the top-level children. For example, creating an ViewStack container triggers the creation of each of its views, but not the controls within those views. The creationPolicy property determines the creation of the child controls inside each view.
When you set the creationPolicy property to auto (the default value), navigator containers instantiate only the controls and their children that appear in the initial view.
When the user navigates to another panel in the Accordion container, the navigator container creates the next set of controls, and recursively creates the new view's controls and their descendants. You can use the ViewStack container's creationPolicy property to modify this behavior.
The possible varlues for creationPolicy are all, auto(default), none and queued.
Thanks for ur quick reply.. and thank u for explanation
1 person found this helpful
Flex will not create the 100 checkboxes at a time. When u r using an ItemRenderer, the checkboxes will be created at runtime.
For example, u have 100 chkboxes, in your runtime flex will display 20 records initially (means 20 chkBoxes), and if you scroll down, flex will then create the next 20 checkboxes. This is a very good feature in FLex IDE.
mark this if helpful
what is the correct answer?? Bhaskar told that in datagrid flex creates 100 check box instances for 100 records ... but u told that only 20 instances will create??
what is the correct answer?? can any one refer the tutorial revealing this problem?
I will go through that tutorial... I am little bit confusion
1 person found this helpful
When u r using itemrenderer, flex will not create the 100 chkBoxes at a time. Checkboxes will be rendered for the first 20 records in the grid. Wneh u scroll down, then next 20 will be rendered. This is correct and i have tested this.
not only chkboxes, anything in itemrenderers, will be created at runtime only.
When your not using ItemRenderers, I agree flex will create the 100 chkboxes at a time.
Sorry I was wrong with my earliar post with itemrenderers...actually if you have 20 items or rows visible in a DataGrid Flex will create 22 itemRenderers—enough to show every visible row, plus a couple for buffering and performance reasons.
And when the user scrolls the list, it may now be showing different rows. But those same 22 itemRenderers are still there: no new itemRenderers are created, even after the list scrolls. So what the Flex does is unless you resize the list, those same itemRenderers are reused and recycled to a new location and are now showing new data.
However as I said in my previous post if you use Repeater component instead of itemRenderers all the 100 check boxes will be created..
I have gone through the tutorial...its very useful and worthy indeed..Check out this link...you will get the most out of the Tutorial...