- A header title
- Some HTML formatted text bullets
- Use variableRowHeight since some entries are a lot taller than others.
This doesn't sound that hard, but I'm having a devil of a time getting this to display properly! When you scroll down and back up, some of the rows collapse entirely, others sprout scroll bars, the scroll thumb keeps changing size, etc.
Is it just a bad idea to try to put HTML formatted code in a data grid? Or is variableRowHeight just buggy? Or am I missing something?
Here's some sample code that illustrates the problem. I'm very grateful for any ideas!
Clarke
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initData()">
<mx:Script>
<![CDATA[
import mx.collections.*;
public var DGArray:Array = [
{description:'Description - 1', detail:'<TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Achive a Data Grid control that actually works properly and can be used in a flex application.</FONT></LI></TEXTFORMAT>'},
{description:'Description - 2', detail:'<TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 1</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 2</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 3</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 4<FONT SIZE="12" COLOR="#E0D8B0"></FONT></FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="12" COLOR="#E0D8B0" LETTERSPACING="0" KERNING="0"></FONT></LI></TEXTFORMAT>'},
{description:'Description - 3', detail:'<TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 1</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 2</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 3</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 4<FONT SIZE="12" COLOR="#E0D8B0"></FONT></FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="12" COLOR="#E0D8B0" LETTERSPACING="0" KERNING="0"></FONT></LI></TEXTFORMAT>'},
{description:'Description - 4', detail:'<TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 1</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 2</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 3</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#000000" LETTERSPACING="0" KERNING="0">Bullet 4<FONT SIZE="12" COLOR="#E0D8B0"></FONT></FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="12" COLOR="#E0D8B0" LETTERSPACING="0" KERNING="0"></FONT></LI></TEXTFORMAT>'} ];
[Bindable]
public var initDG:ArrayCollection;
//Initialize initDG ArrayCollection variable from the Array.
public function initData():void {
initDG=new ArrayCollection(DGArray);
}
]]>
</mx:Script>
<mx:DataGrid id="myGrid" width="350" height="200" dataProvider="{initDG}"
variableRowHeight="true" >
<mx:columns>
<mx:DataGridColumn dataField="description">
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:Text selectable="false" width="100%"
text="{data.description}" fontWeight="bold"/>
<mx:Text htmlText="{ data.detail}" width="100%" />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
__._,_.___
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___