[flexcoders] Datagrid Row Color

2005-12-08 Thread Shahnavaz Alware










Hi,

I am trying to change the color of the entire
single row of a datagrid using cellRenderer. I dont have much experience
using CellRenderer or RowRenderer and have not seen any example where a
cellRenderer changes the property or backgroundColor of entire row. The CellRenderer
setValue() below gives me [Fault] recursion_limit. If
anybody has working example to achieve this would be really helpful.



 function
setValue(str:String, item:Object, sel:Boolean) : Void


{ 


text = String(item.Price);


var price:Number = Number(text);


if(price  100)


{

 
listOwner.dataProvider.editField(getCellIndex().itemIndex,
backgroundColor, 0x00);


}


} else 





Thanks,









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Tuesday, December 06, 2005
8:48 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Datagrid
Issue





listOwner.dataProvider.editField(getCellIndex().itemIndex,
backgroundColor, 0x00)



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of shahnavaz Alware
Sent: Tuesday, December 06, 2005
4:11 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Datagrid
Issue





Thanks Matt,



I was under the impression that when
datagrid sort, will clean itself off. Using the same example how I can make the
cellRenderer change the color of entire row where Price  100? I did tried
using listOwner[getCellIndex().itemIndex].setStyle(backgroundColor,
0x00) with no luck.



Thanks,



Shahn











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Monday, December 05, 2005
6:16 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Datagrid
Issue





Well you still need an else so that you
call setBackgroundColor even when price is less than 100. The cell is
re-used, you need to cover all cases in your setValue function. So your
else statement here can be to setCellBackgroundColor(0xff, 0)



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shahnavaz Alware
Sent: Monday, December 05, 2005
5:17 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Datagrid
Issue





Hi Matt,



The code is not the problem here. I am not
sure if I have to reassign the dataprovider after I click on Price header. I
replaced the script so now I am just checking for Price  100 and when you
sort by price after it renders the result is still the same.







 mx:Script


![CDATA[ 


function setValue(str, item, sel)


{ 


text = String(item.Price);


var price:Number = Number(text);


if(price  100)


{


setCellBackgroundColor(0x00FF00, 100);


}


}





function setCellBackgroundColor(newColor, newAlpha)


{





setStyle(backgroundAlpha, newAlpha==undefined ? 0 :newAlpha);


setStyle(backgroundColor, newColor); 


} 


]]

 /mx:Script











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Monday, December 05, 2005
5:04 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Datagrid
Issue





Dont you need a check for  1000
in your if (price  100) test?











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shahnavaz Alware
Sent: Monday, December 05, 2005
4:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Datagrid
Issue





Hi,



I am using a cellRenderer in my datagrid. Now when I sort by
clicking on header the DatagridColumns on which I have cellRenderer never
cleans up the cell which was rendered by cellRenderer. How can I solve this
issue? Files and screen Image below. 

!Application 

mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml

mx:DataGrid id=myGrid width=350
height=100


mx:columns


mx:Array


mx:DataGridColumn columnName=Artist/


mx:DataGridColumn columnName=Price
cellRenderer=SimpleCustomCellRenderer/


mx:DataGridColumn columnName=Album /


/mx:Array


/mx:columns




mx:dataProvider


mx:Array id=arr


mx:Object Artist= Kapil Album=All Time Favourites
Price=101/


mx:Object Artist= Kapil Album=Classic Songs
Price=10/


/mx:Array


/mx:dataProvider




/mx:DataGrid

/mx:Application



!CellRenderer

mx:TextInput
xmlns:mx=http://www.macromedia.com/2003/mxml

borderStyle=none
backgroundAlpha=0

 mx:Script

 function
setValue(str, item, sel)


{ 


text = String(item.Price);


var price:Number = Number(text);


if(price  100)


{


setCellBackgroundColor(0x00FF00, 100);


}


else if(price  1000)


{


setCellBackgroundColor(0x00FF00, 100);


}

 }

 

 function
setCellBackgroundColor(newColor, newAlpha)

 {





setStyle(backgroundAlpha, newAlpha==undefined ? 0 :newAlpha);


setStyle(backgroundColor, newColor); 

 }

 /mx:Script

/mx:TextInput







After Sorting on Price







Thanks,



Shahn


















--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: 

RE: [flexcoders] Datagrid Row Color based on Value in Column

2005-12-03 Thread Matt Chotin










Add a property called backgroundColor to
each object in the dataProvider and set it to be the same value as the property
you wanted to base it on.



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shahnavaz Alware
Sent: Friday, December 02, 2005
5:44 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Datagrid Row
Color based on Value in Column





Hi,



Is there a way in which I could change the color of the
entire row in DataGrid based on the value in one of the column?



Thanks,



Shahn









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



  











[flexcoders] Datagrid Row Color based on Value in Column

2005-12-02 Thread Shahnavaz Alware










Hi,



Is there a way in which I could change the color of the
entire row in DataGrid based on the value in one of the column?



Thanks,



Shahn









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



  











[flexcoders] DataGrid row color

2005-11-08 Thread sandip_patil01
Hi All,

I want to put alternate row colour of datagrid as white  blue.
Means first row is white then second row is blue  again third row 
white,fourth row blue  so on..
Anybody know this ?If so please let me know how to do this.

Thx in advance,
sandip







 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] DataGrid row color

2005-11-08 Thread Philippe Maegerman





http://weblogs.macromedia.com/mc/archives/FlexStyleExplorer.html

 tab Data Grids property 'Alternating 
row colors'

Philippe 
Maegerman




From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of 
sandip_patil01Sent: mardi 8 novembre 2005 11:32To: 
flexcoders@yahoogroups.comSubject: [flexcoders] DataGrid row 
color
Hi All,I want to put alternate row colour of datagrid as 
white  blue.Means first row is white then second row is blue  
again third row white,fourth row blue  so on..Anybody know this ?If 
so please let me know how to do this.Thx in 
advance,sandip





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



  






--**STATEMENT OF CONFIDENTIALITY** 
This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.
We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.--