Skip navigation
nam1490
Currently Being Moderated

Native event

Jan 27, 2012 1:12 AM

I have created AdvancedDataGrid in flex 4.5.1. under WindowedApplication.I want to handle nativeDragStart event but it gives error as--

 

TypeError: Error #1034: Type Coercion failed: cannot convert mx.events::DragEvent@13a8b511 to mx.events.DragEvent.

          at flash.events::EventDispatcher/dispatchEventFunction()

          at flash.events::EventDispatcher/dispatchEvent()

          at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects \framework\src\mx\core\UIComponent.as:13128]

          at mx.managers::NativeDragManagerImpl/_dispatchDragEvent()[C:\autobuild\ galaga\frameworks\projects\airframework\src\mx\managers\NativeDragMana gerImpl.as:625]

          at mx.managers::NativeDragManagerImpl/nativeDragEventHandler()[C:\autobu ild\galaga\frameworks\projects\airframework\src\mx\managers\NativeDrag ManagerImpl.as:598]

 

I have used following code--

 

<?xml version="1.0" encoding="utf-8"?>

<!-- http://blog.flexexamples.com/2007/09/19/dragging-rows-between-two-diff erent-flex-datagrid-controls/ -->

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"

                                        layout="horizontal"

                                        verticalAlign="middle"

                                        backgroundColor="white">

          <mx:Script>

 

                    <![CDATA[

                                   import mx.controls.Alert;

                         protected function adg1_nativeDragStartHandler(event:NativeDragEvent):void

                                   {

                                                      // TODO Auto-generated method stub

                                                       Alert.show("Native Event Handler");

                                   }

                    ]]>

 

          </mx:Script>

               <mx:ArrayCollection id="arr">

                         <mx:Object colA="Item A.0" colB="Item B.0" colC="Item C.0" />

                         <mx:Object colA="Item A.1" colB="Item B.1" colC="Item C.1" />

                         <mx:Object colA="Item A.2" colB="Item B.2" colC="Item C.2" />

                         <mx:Object colA="Item A.3" colB="Item B.3" colC="Item C.3" />

                         <mx:Object colA="Item A.4" colB="Item B.4" colC="Item C.4" />

                         <mx:Object colA="Item A.5" colB="Item B.5" colC="Item C.5" />

                         <mx:Object colA="Item A.6" colB="Item B.6" colC="Item C.6" />

                         <mx:Object colA="Item A.7" colB="Item B.7" colC="Item C.7" />

                         <mx:Object colA="Item A.8" colB="Item B.8" colC="Item C.8" />

                         <mx:Object colA="Item A.9" colB="Item B.9" colC="Item C.9" />

               </mx:ArrayCollection>

          <mx:AdvancedDataGrid id="adg1" designViewDataType="tree" dataProvider="{arr}" dragEnabled="true" dropEnabled="true" nativeDragStart="adg1_nativeDragStartHandler(event)">

                         <mx:columns>

                                        <mx:AdvancedDataGridColumn dataField="colA" headerText="Column 1"/>

                                        <mx:AdvancedDataGridColumn dataField="colA" headerText="Column 2"/>

                                       <mx:AdvancedDataGridColumn dataField="colA" headerText="Column 3"/>

                         </mx:columns>

          </mx:AdvancedDataGrid>

 

</mx:WindowedApplication>

 

someone please help me.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points