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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Christian Chua
Sent: Monday, April 16, 2007 6:02 PM
To: flexcoders@yahoogroups.com
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: flexcoders@yahoogroups.com
<mailto:flexcoders@yahoogroups.com>
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: flexcoders@yahoogroups.com
<mailto:flexcoders@yahoogroups.com> [mailto:[EMAIL PROTECTED]
On Behalf Of Christian Chua
Sent: Monday, April 16, 2007 4:20 PM
To: flexcoders@yahoogroups.com
<mailto:flexcoders@yahoogroups.com>
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