Thank you It is a little heavy-handed, but was able to achieve <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.controls.dataGridClasses.DataGridColumn; import mx.controls.dataGridClasses.DataGridHeader; import mx.events.DataGridEvent; private var obj:Object; private var colIdx:int; protected function grid1_headerReleaseHandler(event:DataGridEvent=null):void { trace("DataGrid headerRelease Event"); colIdx = event.columnIndex event.preventDefault(); } protected function grid1_mouseDownHandler(event:MouseEvent=null):void { trace("DataGrid mouseDown Event"); obj = event.target; } protected function grid1_mouseUpHandler(event:MouseEvent=null):void { trace("DataGrid mouseUp Event"); if (event.target.parent is DataGridHeader && obj == event.target) { var e:DataGridEvent = new DataGridEvent(DataGridEvent.HEADER_RELEASE, true, false, colIdx); event.target.dispatchEvent(e); } } ]]> </mx:Script> <mx:Canvas width="202" height="50" backgroundColor="#FA0505"> <mx:Label x="29" y="14" text="POS1"/> <mx:Label x="126" y="14" text="POS2"/> </mx:Canvas> <mx:DataGrid id="grid1" x="0" y="63" draggableColumns="false" editable="false" headerRelease="grid1_headerReleaseHandler(event)" mouseDown="grid1_mouseDownHandler(event)" mouseUp="grid1_mouseUpHandler(event)"> <mx:columns> <mx:DataGridColumn headerText="COL1" dataField="col1"/> <mx:DataGridColumn headerText="COL2" dataField="col2"/> </mx:columns> <mx:ArrayCollection> <mx:Object col1="ABC" col2="123"/> <mx:Object col1="DEF" col2="456"/> <mx:Object col1="GHI" col2="789"/> </mx:ArrayCollection> </mx:DataGrid> </mx:Application>
> You could try tracking MOUSE_DOWN and MOUSE_UP and see if they are in the > same header renderer. > > On 2/24/14 9:24 PM, "Kouichi Iida" <[email protected]> wrote: > > >That's right > > > >I Place the sample > > > >Example > >No1. Click the COL1, and release at the POS1⇒COL1 is sorted(NG) > >No2. Click the COL1, and passed over the COL2, and release at the > >POS2⇒COL2 is sorted(NG) > >No3. Click the COL1, and passed over the COL2, and release at the > >POS1⇒Not sorted(OK) > > > >I want to cancel the Headerrelease events No1 and No2 > > > ><?xml version="1.0" encoding="utf-8"?> > ><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > >layout="absolute"> > > <mx:Script> > > <![CDATA[ > > import mx.events.DataGridEvent; > > private function grid1_headerReleaseHandler(e:Event=null):void { > > trace("DataGrid headerRelease Event"); > > } > > ]]> > > </mx:Script> > > <mx:Canvas width="202" height="50" backgroundColor="#FA0505"> > > <mx:Label x="29" y="14" text="POS1"/> > > <mx:Label x="126" y="14" text="POS2"/> > > </mx:Canvas> > > <mx:DataGrid id="grid1" x="0" y="63" > > draggableColumns="false" editable="false" > > headerRelease="grid1_headerReleaseHandler(event)"> > > <mx:columns> > > <mx:DataGridColumn headerText="COL1" dataField="col1"/> > > <mx:DataGridColumn headerText="COL2" dataField="col2"/> > > </mx:columns> > > <mx:ArrayCollection> > > <mx:Object col1="ABC" col2="123"/> > > <mx:Object col1="DEF" col2="456"/> > > <mx:Object col1="GHI" col2="789"/> > > </mx:ArrayCollection> > > </mx:DataGrid> > ></mx:Application> > > > >> Hi, it might be easier to understand your question if you provide a > >>simple test case. > >> > >> Sent via the PANTECH Discover, an AT&T 4G LTE smartphone. > >> > >> Kouichi Iida <[email protected]> wrote: > >> > >> Nice to meet you, too > >> > >> I am using SDK 4.11 > >> It is also dispatched except when headerRelease event releases > >> the mouse button on a column header, how do I do this if you want to > >> cancel, except when you release the mouse button on a column header > >> > >> --kouichi > >
