Bruce,
This topic actually was a part of 4th of July celebration and was primarily discussed from the performance perspective. Here is the recent posts unearthing the topic:
http://flexblog.faratasystems.com/?p=96
http://flexblog.faratasystems.com/?p=91
 
 
We use slghtly different syntax allowing us to use run-time styles - ie mix fixed values with formulas
To run please click here and use right mouse to se the source of the usage:
http://flexblog.faratasystems.com/performance/grid_performance2.html
 
Here is snaphot for those who would rather see but not click:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
     xmlns="*" layout="vertical" 
     xmlns:lib="com.theriabook.controls.*" viewSourceURL="srcview/index.html">
<mx:Style>
    .dgHeaderStyle {
        textAlign:center;
        fontWeight : bold;
        backgroundAlpha:.5;
    }
</mx:Style>
<mx:Script>
    <![CDATA[
        include "Employees.inc";
        private function salaryColor(item:*)
:int{ return item.SALARY<50000?0xff0000:0x0000ff;
}
    ]]>
</mx:Script>
    <lib:DataGridEx  id="a"  width="100%" height="100%" headerStyleName="
dgHeaderStyle"
            dataProvider="{getEmployees()}">
        <lib:columns> 
            <mx:Array> 
                <mx:DataGridColumn   dataField="EMP_LNAME"   /> 
                <mx:DataGridColumn   dataField="EMP_FNAME"  /> 
                <lib:DataGridColumnEx   dataField="DEPT_ID" 
                    props="{{&apos;resource&apos;:&apos;employee&apos;
,&apos;keyColumn&apos;:&apos;dept_id&apos;,&apos;autoFill&apos;
:&apos;true&apos;}}"/> 
                <lib:DataGridColumnEx    dataField="PHONE"    formatString="phone" 
/> 
                <lib:DataGridColumnEx    dataField="BENE_DAY_CARE"  
                    itemRenderer="com.theriabook.controls.CheckBox"   
                    rendererIsEditor="true"  editorDataField="value"   
                    textAlign="center" paddingLeft="5"  
                    expando="{{&apos;onValue&apos;:&apos;Y&apos;
,&apos;offValue&apos;:&apos;N&apos;}}" />

                <lib:DataGridColumnEx    dataField="SS_NUMBER"    formatString="ssn"  
/>
                <lib:DataGridColumnEx    dataField="SALARY"  formatString="currency" 
                        styles="{{&apos;color&apos;:salaryColor,
&apos;fontWeight&apos;:function (item:*)
:String{ return item.SALARY > 50000?{ return item.SALARY
 > 50000?&apos;bold&apos;:&apos;normal&apos;} }}"
                />                    
                <lib:DataGridColumnEx    dataField="SALARY"  formatString="currency"  editable="
true"    >
                        <lib:styles>
                            <mx:Object backgroundColor="{salaryColor}" backgroundAlpha="
.3"/> 
                        </lib:styles>
                </lib:DataGridColumnEx>        
                <lib:DataGridColumnEx    dataField="START_DATE" formatString="shortdate"
/>                    
            
                <!--lib:DataGridColumnEx    dataField="BONUS"   formatString="currency" 
                        computedFields="{{&apos;BONUS&apos;:function(data:*):Number { return data.SALARY*.1;}}}"
                /-->
<!-- ,&apos;toolTip&apos;:[&apos;prop&apos;,function(data:*):String { return &apos;Proposed bonus &apos; + data.SALARY*.1;}] 
-->
            </mx:Array>
        </lib:columns>
    </lib:DataGridEx>
</mx:Application>
Much nicer version of what you can do with itemRenderers is going to be in chapter 11 of upcoming RIA book and 3 next issues of ColdFusion magazine. But if you are serious about rather buying then building this stuff - I can post simple  on Exchange for a price of pizza and a beer ($9.99) - is anyone interested?
 
Happy Halloween,
Anatole Tartakovsky

www.faratasystems.com
 
 
 
 

 
On 10/5/06, boy_trike <[EMAIL PROTECTED]> wrote:

Lets pretend that Halloween is a holiday where one would ask for a TREAT (not a trick).

The treat I would request is to have a DATAGRIDCOLUMN have a feature JUST like
labelFunction called styleFunction with the ability to change the following for the current
cell:

Background color
font style (bold, italics, none)
font size

It would be nice if it had a signature something like:
styleFunction (S: styleObject) : styleObject
then I could write
S.fontsize = 16;
S.style = "bold"
return S

questions:
Am I the only one who wants / needs this functionality.?
Is this difficult?

Thanks
Bruce

P.S. Before anyone says, "If you want it, build it", my response is I would rather buy not
build components.



__._,_.___





--
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
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to