Skip navigation
JoséTeixeira
Currently Being Moderated

BackGround Row Color Data Grid

Feb 27, 2013 11:23 AM

Hello,

 

In My Application have alternativeRows :

 


s|DataGrid {



alternatingRowColors: #b2cbe7, #ffffff;


}

 

 

I need to have a certain Row Background Color: # cccccc by pressing the DELETE key.

 

Example:

 

if (event.keyCode == Keyboard.DELETE) {

 

 

if (DG_ITENS.selectedCell.columnIndex == 0) {

 

   / / Row BackGround Color # cccccc

  }

}

 

 

Thanks

 
Replies
  • Currently Being Moderated
    Feb 27, 2013 10:17 PM   in reply to JoséTeixeira

    use datagrid_id.setStyle(parameters) .

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2013 6:25 AM   in reply to JoséTeixeira

    Do you plan on having a column in the array that states the row "isDeleted"?  So, when you select the row, you would set the value "isDeleted" to false.  Then the itemRenderer for the row would know to change the background style for that row.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2013 8:38 AM   in reply to JoséTeixeira

    Here is my example of DataGrid with Row Background Update.  I set the ArrayCollection value, so that the renderer knows to take an action.

    I noticed that when attempting to do a DELETE, the first time doesn't work and you have to select again.  This seems to only happen on the blog post and not when debugging/running directly from Flex Builder.

     

    I'm not sure if this will help you with your solution, because it looks like you are trying to change a particular row when a key is clicked.  If the grid is sorted, I don't think that would work and most likely would give you a ghosting (duplicate rows) effect.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2013 9:19 AM   in reply to JoséTeixeira

    How did you resolve it?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 28, 2013 10:22 AM   in reply to JoséTeixeira

    Forgot to add the link.

     

    View Source for Simple DataGrid with Row Background Update . It is also on the Flex Examples section.

     

     

    If this is the solution for your issue, make sure you click the link that makes it so.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)