Re: [flexcoders] Changing the background color of row in datagrid
Parekh, Shweta - BLS CTR wrote: I also tried using employee_dg.rows[rowInd].backgroundColor = 0xfff00; for changing the background color for a row but this does not work. This should probably be added the to FAQ as it gets asked a lot: // Use setPropertiesAt to set the background color of an individual row: theListOrGrid.setPropertiesAt( rowIndex, { backgroundColor: 0xFF } ); -d Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
RE: [flexcoders] Changing the background color of row in datagrid
Title: Message Darron, I did use setPropertiesAt function as you have suggested. But my problem is that when I use it the way you have suggested, employee_dg.setPropertiesAt(rowInd, {backgroundColor:0xFFF00}); the bg color of the row does not change instanlty. I have to click somewhere in the datagrid for the color change to take place whereas when I hard code the row index ie. employee_dg.setPropertiesAt(1, {backgroundColor:0xFFF00}); the bg color is changed instantly. I need not click on the datagrid for it to do it. Could you tell me why? Attached is a sample app to see this peculiar behavior.. Thanks, Shweta ___ Shweta Parekh Bureau of Labor Statistics, Room# 5930 202.691.7449 -Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Darron J. SchallSent: Tuesday, November 08, 2005 3:35 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Changing the background color of row in datagridParekh, Shweta - BLS CTR wrote: I also tried using employee_dg.rows[rowInd].backgroundColor = "0xfff00"; for changing the background color for a row but this does not work.This should probably be added the to FAQ as it gets asked a lot:// Use "setPropertiesAt" to set the background color of an individual row:theListOrGrid.setPropertiesAt( rowIndex, { backgroundColor: 0xFF } );-d -- 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. deptComp.mxml Description: deptComp.mxml department.mxml Description: department.mxml ?xml version=1.0 encoding=utf-8? departments department deptId01/deptId deptNameAccounting/deptName employees employee nameChristina Coenraets/name phone555-219-2270/phone email[EMAIL PROTECTED]/email activetrue/active /employee employee nameLouis Freligh/name phone555-219-2100/phone email[EMAIL PROTECTED]/email activetrue/active /employee employee nameRonnie Hodgman/name phone555-219-2030/phone email[EMAIL PROTECTED]/email activefalse/active /employee employee nameJoanne Wall/name phone555-219-2012/phone email[EMAIL PROTECTED]/email activetrue/active /employee /employees /department department deptId02/deptId deptNameHuman Resource/deptName employees employee nameMaurice Smith/name phone555-219-2012/phone email[EMAIL PROTECTED]/email activefalse/active /employee employee nameMary Jones/name phone555-219-2000/phone email[EMAIL PROTECTED]/email activetrue/active /employee /employees /department /departments
Re: [flexcoders] Changing the background color of row in datagrid
we did this recently. Didn't like the setProperties() approach for our situation. We had a colour attribute in our dataprovider. So we ended up with something like this for a custom cell renderer. We have not polished it fully yet, but the idea is there. ?xml version=1.0 encoding=UTF-8? mx:Canvas xmlns:mx=http://www.macromedia.com/2003/mxml height=49 width=100% mx:Script ![CDATA[ function setValue( str:String, item:Object, sel:Boolean ) { this.d.text = item.activity; this.setStyle(backgroundColor, item.color); } ]] /mx:Script !-- mx:Text x={ (this.width - d.width)/2 } y={ (this.height)/2 } id=d height=100% width=100 fontSize=12 fontWeight=bold selectable=false/ -- mx:Text id=d height=100% width=100 marginTop=5 marginBottom=5 fontSize=12 fontWeight=bold selectable=false/ /mx:CanvasOn 11/8/05, Parekh, Shweta - BLS CTR [EMAIL PROTECTED] wrote: Darron, I did use setPropertiesAt function as you have suggested. But my problem is that when I use it the way you have suggested, employee_dg.setPropertiesAt(rowInd, {backgroundColor:0xFFF00}); the bg color of the row does not change instanlty. I have to click somewhere in the datagrid for the color change to take place whereas when I hard code the row index ie. employee_dg.setPropertiesAt(1, {backgroundColor:0xFFF00}); the bg color is changed instantly. I need not click on the datagrid for it to do it. Could you tell me why? Attached is a sample app to see this peculiar behavior.. Thanks, Shweta ___ Shweta Parekh Bureau of Labor Statistics, Room# 5930 202.691.7449 -Original Message-From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Darron J. SchallSent: Tuesday, November 08, 2005 3:35 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] Changing the background color of row in datagridParekh, Shweta - BLS CTR wrote: I also tried using employee_dg.rows[rowInd].backgroundColor = 0xfff00; for changing the background color for a row but this does not work.This should probably be added the to FAQ as it gets asked a lot:// Use setPropertiesAt to set the background color of an individual row:theListOrGrid.setPropertiesAt( rowIndex, { backgroundColor: 0xFF } );-d -- 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. -- Douglas Knudsenhttp://www.cubicleman.comthis is my signature, like it? -- 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 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.