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:
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:
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="{{'resource':'employee' ,'keyColumn':'dept_id','autoFill' :'true'}}"/> <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="{{'onValue':'Y' ,'offValue':'N'}}" /> <lib:DataGridColumnEx dataField="SS_NUMBER" formatString="ssn" /> <lib:DataGridColumnEx dataField="SALARY" formatString="currency" styles="{{'color':salaryColor, 'fontWeight':function (item:*) :String{ return item.SALARY > 50000?{ return item.SALARY > 50000?'bold':'normal'} }}" /> <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="{{'BONUS':function(data:*):Number { return data.SALARY*.1;}}}" /--> <!-- ,'toolTip':['prop',function(data:*):String { return 'Proposed bonus ' + 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.comOn 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

