[flexcoders] Re: highlight a cell in datagrid

2010-04-15 Thread valdhor
Use the data grid highlightItemRenderer?

--- In flexcoders@yahoogroups.com, sathish_mca_raja sathish_mca_r...@... 
wrote:

 I want to use 2 selection indicators in a data grid at the same time.
 
 I will use one to highlight a row.
 
 I will use another to highlight a particular cell in the highlighted row in a 
 different color.
 
 Please let me know if you have any ideas.





Re: [flexcoders] Re: highlight a cell in datagrid

2010-04-15 Thread Greg Hess
I am having the same challenge right now too.

My DataGrid is a custom extension and did try using the protected
highlightItemRenderer with a public method I exposed but didnt work for me,
even with an invalidateDisplayList and validateNow after setting the
poperty.

Many web examples do it by setting the selectedItem of the dataGrid to the
item under the dragEvent, but I cant change my selection. So I have been
able to do it by:

- CustomDataGrid exposes two new functions highlightItem(
ir:IListItermRenderer) and clearHighlight( ir:IListItemRenderer )
- DataGrid.dragOver handler calls highlightItem and clearHighlight on last
highlighted item(holds reference)
- DataGrid.dragExit handler calls clearHighlight

public function highlightItem( ir:IListItemRenderer ):void
{
drawItem( ir, false, true );
}

public function clearHighlight( ir:IListItemRenderer ):void
{
drawItem( ir );
}

Works for me, just make sure you dont highlight/clear the selected item as
my logic prevents that.

HTH,

Greg

On Thu, Apr 15, 2010 at 2:42 PM, valdhor valdhorli...@embarqmail.comwrote:



 Use the data grid highlightItemRenderer?


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 sathish_mca_raja sathish_mca_r...@... wrote:
 
  I want to use 2 selection indicators in a data grid at the same time.
 
  I will use one to highlight a row.
 
  I will use another to highlight a particular cell in the highlighted row
 in a different color.
 
  Please let me know if you have any ideas.