On 5/16/05, Reto M. Kiefer <[EMAIL PROTECTED]> wrote:

> I have a handler that should set a selected row in a datagrid to bold.
> The only thing I figured out is the highlighting for colums:
> 
> function renderCell(event) {
>      grid1.getColumnAt(event.columnIndex).setStyle("fontSize", 14);
> }
> 
> (The renderCell is called on cellPress in the data grid.)

    function renderCell(event)
    {
      var grid:DataGrid = DataGrid(event.target);

      var lastSelectedIndex:Number = grid["lastSelectedIndex"];
      if (lastSelectedIndex != undefined)
        grid.rows[lastSelectedIndex].setStyle('fontWeight', 'normal');
      grid["lastSelectedIndex"] = grid.selectedIndex;

      grid.rows[grid.selectedIndex].setStyle('fontWeight', 'bold');
    }

I think you should do this in the 'change' handler though, because the
selectedIndex can also be set programmatically or by other means (?). 
Also if you have 'multipleSelection' set to true then you want to
handle 'selectedIndices' too.


 
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/
 


Reply via email to