Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 29 other followers

  • Archives

  • Categories

  • Stats

    • 379,210
  • Live Traffic

Tips&Tricks: Flex expand AdvancedDataGrid tree column on load

Posted by Jai on August 18, 2009

Use displayExpandItems=”true” to expand all the elements of the tree component items on initial load.


<mx:AdvancedDataGrid groupItemRenderer="com.test.CheckBoxTreeRenderer"
				id="dataGrid"
				dataProvider="{appModel.list}"
	 			width="90%"
				height="100%"
				displayItemsExpanded="true">
	 		<mx:columns>
	 			<mx:AdvancedDataGridColumn id="labelColumn" dataField="label" headerText="Data"/>
	 		</mx:columns>
</mx:AdvancedDataGrid>

The problem with expandAll() to be called on creation is that the model may not be updated at that moment.

8 Responses to “Tips&Tricks: Flex expand AdvancedDataGrid tree column on load”

  1. Sasha Dzeletovic said

    Thanks Jai!
    I had the exact same problem with expandAll(). This is an efficient shortcut.

  2. Robertus said

    Nice article. I have problem in expanding tree on load. Thanks

  3. Chuck said

    Thanks this is very helpful

  4. Oswaldo said

    Thanks! Simple but effective

  5. Hichem Ben Abdallah said

    Hi Jai,

    You can use the method “callLater” to guarantee that all nodes will be expanded at the right moment.

  6. Ahmed Malik said

    Hey Jaibeer

    Thank you for the great info. This helps expanding but later collapseAll() doesn’t work at all. Any idea how that can be made to work too?

    Best regards,
    Ahmed Malik.

  7. Ahmed Malik said

    Got it… you need to have

    displayItemsExpanded=”false”;

    before… collapseAll();

    Thanks.

    Best regards,
    Ahmed.

  8. mathi said

    help me pls….
    In advanced datagridcolumns i need to expand particular row after edit or new node to save…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: