Does the lag happen when the renderer is not there?

Cause if it is, then are u loading all 1000 records into the client? Maybe you 
can use FDS and the paging feature.

Dimitrios 
Optimal Payments.

-----Original Message-----
From: flexcoders@yahoogroups.com on behalf of Pan Troglodytes
Sent: Thu 7/13/2006 7:41 PM
To: flexcoders
Subject: [flexcoders] efficient way of doing custom formatting on datagrid 
column values
 
I have a datagrid with a half-dozen columns, all but one numeric.  I've used
itemrenderers to make a label with a built in formatter to get them nice
looking:

<mx:DataGridColumn headerText="Htl Bkgs" paddingRight="4"
dataField="Bookings">
  <mx:itemRenderer>
    <mx:Component>
      <mx:Label width="100%" height="100%" text="{fmt.format(data.Bookings
)}">
        <mx:NumberFormatter id="fmt" useThousandsSeparator="true"/>
      </mx:Label>
    </mx:Component>
  </mx:itemRenderer>
</mx:DataGridColumn>

Looks cool, but makes for horribly laggy performance when scrolling around
the grid with about 1000 records.  What's a better way to do this?  Is there
one or are we stuck with this?

Alternately, I've modified the data so that it's formatted when the data is
loaded.  But this screws up the sorting requiring me to write custom
sorters.  I've also tried breaking out my renderer into another class, but I
still have to create a formatter for every instance since it can't see the
one outside of the renderer.  I think this is where the bulk of the slowness
is.

Of course, this may be a moot point.  I have some columns that need the text
to be colorered depending on value.  When I put an item renderer label on
those with color="{data.value &lt; 0 ? 0xFF0000 : 0x008000}", this bogs down
the scrolling, too.  Not sure how I'll get around that.

This just all seems like a lot of trouble and I'm hoping I'm missing
something.

-- 
Jason

-- 
WARNING
-------
This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the use of 
the intended recipient.  No privilege or other rights are waived by any 
unintended transmission or unauthorized retransmission of this message.  If you 
are not the intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete it and all 
attachments from your system.  The reading, distribution, copying or other use 
of this message or its attachments by unintended recipients is unauthorized and 
may be unlawful.  If you have received this e-mail in error, please notify the 
sender.

AVIS IMPORTANT
--------------
Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés destinés au 
seul usage du destinataire visé.  L'expéditeur original ne renonce à aucun 
privilège ou à aucun autre droit si le présent message a été transmis 
involontairement ou s'il est retransmis sans son autorisation.  Si vous n'êtes 
pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, 
veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système.  La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des personnes 
autres que le destinataire visé ne sont pas autorisés et pourraient être 
illégaux.  Si vous avez reçu ce courrier électronique par erreur, veuillez en 
aviser l'expéditeur.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to