Has anyone had a chance to take a look at it?

2005/11/10, Paolo Bernardini <[EMAIL PROTECTED]>:
I was testing a simple application to see if it was possible to have
a custom cellRenderer that displays multple rows of data depending
on the dataProvider's value. Then setting variableRowHeight="true"
on the dataGrid that uses the cellRenderer I wanted to see if the
rowHeight was adjusting to the height of the cellRenderer.

It did, but then I've noticed to problem. I'll attach the source
code to make myself clearer.

Application code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml ">
   <mx:Model id="myDP">
       <item num="1" fname="Christina"
email="[EMAIL PROTECTED]" state="MA" status="active">
         <multiRows label="one"/>
         <multiRows label="two"/>
         <multiRows label="three"/>
                 <multiRows2 label="three"/>
       </item>
       <item num="2" fname="Louis" email="[EMAIL PROTECTED]"
state="FL" status="active">
         <multiRows label="one"/>
                 <multiRows2 label="three"/>
       </item>
               <item num="3" fname="Bob" email=" [EMAIL PROTECTED]"
state="CA" status="active">
         <multiRows label="one"/>
         <multiRows label="two"/>
                 <multiRows2 label="three"/>
                 <multiRows2 label="three"/>
                 <multiRows2 label="three"/>
       </item>
       <item num="3" fname="Bob" email=" [EMAIL PROTECTED]"
state="CA" status="active">
         <multiRows label="one"/>
         <multiRows label="two"/>
                 <multiRows label="three"/>
                 <multiRows label="four"/>
                 <multiRows2 label="three"/>
                 <multiRows2 label="three"/>
       </item>
   </mx:Model>
   <mx:DataGrid id="dg1" dataProvider="{myDP.item}"
editable="false" hScrollPolicy="off" variableRowHeight="true"
width="50%" height="100%" verticalAlign="top" hGridLines="true"
hGridLineColor="#000000">
     <mx:columns>
       <mx:Array>
         <mx:DataGridColumn columnName="num" headerText="num"/>
         <mx:DataGridColumn columnName="fname" headerText="name"/>
         <mx:DataGridColumn columnName="email" headerText="Email"/>
         <mx:DataGridColumn columnName="state" headerText="State"/>
         <mx:DataGridColumn columnName="status"
headerText="Status"/>
         <mx:DataGridColumn columnName="multiRows"
headerText="multiRows" cellRenderer="ManyLabels"/>
                 <mx:DataGridColumn columnName="multiRows2"
headerText="multiRows2" cellRenderer="ManyLabels"/>
       </mx:Array>
     </mx:columns>
   </mx:DataGrid>
</mx:Application>


CellRenderer code:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml "
borderStyle="none"
backgroundAlpha="0"
marginLeft="0" marginRight="0" horizontalAlign="center">
     <mx:Script>
<![CDATA[
var listOwner : MovieClip;
var getCellIndex : Function;
var getDataLabel : Function;
var isCellEditor : Boolean = true;

function setValue(str:String, item:Object, sel:Boolean) : Void{
       if (item[getDataLabel()] == undefined) {
               this.visible = false;
       } else {
               this.visible = true;
               rp.dataProvider = item[getDataLabel()];
       }
}
]]>
</mx:Script>
     <mx:Repeater id="rp">
       <mx:Label text="{rp.currentItem.label}" />
     </mx:Repeater>
   </mx:VBox>


Now the main problem is that if in the model I have only one item as
data for the repeater that value dosem't show.

The other issue is that when I roll over the cell that uses the
CellRenderer I notice a very annoying flicker.





------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/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/






--
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