Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Style Quirk

Status
Not open for further replies.

kgaard

Programmer
Nov 23, 2003
18
US
I have a datagrid that I am populating on the fly with data from an XML document - however, I want to change the text size to smaller than the default value... I can change it no problem, but is there any way to avoid the 2 seconds of the default font styles before it recognizes the style change?

I've tried changing it both for the specific instance of the DG, and also globally, but neither resolve the problem - any ideas?

not a mission critical problem, but fairly annoying...

thanks in advance!

Chris
 
I don't know how you're creating the DataGrid instance, but if you create the instance dynamically using createClassObject there will be no delay whatsoever - the DataGrid instance will be drawn on Stage with the font size (and whatever other styles) you set from the beginning.

Kenneth Kawamoto
 
Kenneth,

That makes sense, I was loading an instance that I had dragged onto the stage. In the end I'm trying to load the datagrids into movieclips that are inside of an accordion...

//import the dataGrid class
import mx.controls.DataGrid;

//Create datagrid @ runtime
createClassObject(DataGrid,"myDg",getNexthighestDepth());
myDg.setSize(300,260);
myDg.move(50, 50);

this seems to be the most basic implementation, but when it runs I dont get an instance on the stage...

also, how would i target the specific movie clips i need for the accordion?


thanks!



 
i ran into a similar problem with the accordion

got round it by loading a swf into the movie clip in the form
 
>this seems to be the most basic implementation, but when it runs I dont get an instance on the stage...

I know; this happens to me always. Bloody components...

Anyway, make sure the component is in the Library. Then drag the component on Stage. Test movie. Verify two components appear on Stage (one you physically placed on Stage, the other dynamic) - you may need to do this several times. Once you verify two components, you can safely remove the one you dragged on stage.

I'll have a look at Accordion - did Bill's work around work?

Kenneth Kawamoto
 
Yep, I can create an Accordion instance dynamically, then create a child using an empty MovieClip from Library, then create a DataGrid instance in that MovieClip with small font - all in one go.

To reference the DataGrid instance created using above, just do:
accordionInstance.movieClipInstance.dataGridInstance.fontSize = 8

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top