0

I'm having troubles expanding the root node of my AdvancedDataGrid. Simplified code below:

adg.addEventListener(FlexEvent.CREATION_COMPLETE, adgCreationHandler);

private function adgCreationHandler(event.FlexEvent): void {
   adg.expandItem(groupCol.getRoot(), true)
}

Does anyone have any thoughts on why this approach won't expand my root node, or another easy way of expanding the root node by default when the AdvancedDataGrid is loaded?

Sebastian
  • 436
  • 5
  • 24

1 Answers1

1

try the following

private function adgCreationHandler(event.FlexEvent): void {
   adg.expandItem(groupCol.getRoot(), true)
   adg.validateNow();
}

validateNow() - From Flex Manual

Validate and update the properties and layout of this object and redraw it, if necessary. Processing properties that require substantial computation are normally not processed until the script finishes executing. For example setting the width property is delayed, because it can require recalculating the widths of the objects children or its parent. Delaying the processing prevents it from being repeated multiple times if the script sets the width property more than once. This method lets you manually override this behavior.

Adrian Pirvulescu
  • 4,308
  • 3
  • 30
  • 47
  • Thanks for the help, but im afraid it did not work. It still does not expand the root node :-/ Any other ideas? ;) Or any other approaches i can use for expanding the root? – Sebastian Feb 27 '12 at 20:53