Don't know of any existing samples.  I think it would look something
like:
 
public class ChuaDataGrid extends DataGrid
{
 
 override protected function mouseDownHandler(event:MouseEvent):void
 {
        var r:IListItemRenderer;
        var s:Sprite;
 
        // find out if we hit the sort arrow
        s = Sprite(listContent.getChildByName("sortArrowHitArea"));
 
        if (event.target != s)
  {
            r = mouseEventToItemRenderer(event);
 
   if (listItems.length)
   {
 
    // find out if we clicked on a something other than first column
    var n:int = listItems.length;
    for (var i:int = 0; i < n; i++)
    {
     // if we did click on a something other than first column, bail
     if (r != listItems[i][0])
     {
      return;
     }
    }
   }
  }
  super.mouseDownHandler(event);
 }

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Christian Chua
Sent: Monday, April 16, 2007 6:02 PM
To: [email protected]
Subject: Re: [flexcoders] Datagrid selection enabled only on first
column



Alex,
 
Thanks for your advice.
 
Any chance you can point me to a website with .mxml files that implement
this idea ?
 
Thanks,
Christian
 
 
 

        ----- Original Message ----- 
        From: Alex Harui <mailto:[EMAIL PROTECTED]>  
        To: [email protected]
<mailto:[email protected]>  
        Sent: Monday, April 16, 2007 5:51 PM
        Subject: RE: [flexcoders] Datagrid selection enabled only on
first column


        
        There is no flag or option.  You can subclass, override
mouseDownHandler and bail out if something you don't like got pressed.

________________________________

        From: [email protected]
<mailto:[email protected]>  [mailto:[EMAIL PROTECTED]
On Behalf Of Christian Chua
        Sent: Monday, April 16, 2007 4:20 PM
        To: [email protected]
<mailto:[email protected]> 
        Subject: [flexcoders] Datagrid selection enabled only on first
column
        
        

        Hello.
        
        Is there a way to tell the DataGrid component to trigger
selection only on 
        the first column ?
        The default behavior is that clicking anywhere on the row
selects the row.
        
        Thanks,
        Christian 
        

        

 

Reply via email to