Hi Alex thanks for reply, the r = mouseEventToItemRenderer(event); is 
returning null if I hit the header (DataGridHeader), and the 
ListBaseContentHolder. Can I get a index from somewhere, I have try 
to get the index and it seams like it have a delay, I'm getting the 
pri value, I have to click it two times before the index changes.


--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> You want to know if the header got clicked?  Try
> 
>  
> 
> If (r.data is DataGridColumn)
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Cato Paus
> Sent: Tuesday, April 22, 2008 6:23 AM
> To: [email protected]
> Subject: [flexcoders] Overriding the mouseClickHandler in DataGrid
> 
>  
> 
> Hi Alex, do you have a better suggestion?
> 
> override protected function mouseClickHandler(event:MouseEvent):void
> {
> var pattern:RegExp = /DataGridHeader/;
> var test:String = String(event.target);
> if(pattern.test(test)){
> var r:IListItemRenderer;
> r = mouseEventToItemRenderer(event);
> if(r)
> {
> super.mouseClickHandler(event);
> }
> else
> {
> clearSelected(true);
> dispatchEvent(new ListEvent(ListEvent.CHANGE));
> event.stopImmediatePropagation();
> }
> }
> }
>


Reply via email to