On 5/1/06, Chris Scott <[EMAIL PROTECTED]> wrote:

> Hi I'm wondering if anyone has done an extended dataGrid component or
> can shed some light on the direction to take on building a dataGrid
> that autosizes it's columns to the size of the data contained,
> similar to how a normal grid component filled with text fields would
> work, but of course I need it to me sortable and scrollable, so the
> dataGrid is really what I want. I'm considering trying to handle an
> event when data is loaded to each cell to increase a width var if the
> new value us larger, then set the column widths to that var, but I'm
> getting a little bogged down with what events to attach eventHandlers
> to. Any advice is appreciated, thanks!

Listen for the CollectionEvent.COLLECTION_CHANGE event. Iterate over
the items to calculate their approximate widths (you could use a
single TextField for this), taking the maximum of them, and set the
width of the column explicitly to that value (the columns can be
accessed through the 'columns' property).

Manish


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to