0 Replies Latest reply on Jan 16, 2010 5:52 AM by Prashant Waykar

    Adding drag drop facility to the popupbutton component

    Prashant Waykar

      Hello Sir,

      I need some help in adding drag drop facility to the popupbutton in which i have added datagrid component.

      I this i want to drag drop elements but it works perfectly fine in chrome but not in IE and Firefox.

      It gives null object reference.here is my code...

       

       

       

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

      <!-- http://blog.flexexamples.com/2008/02/01/using-a-datagrid-control-as-a-pop-up-in-the-flex-p opupbutton-control/ -->

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

              layout="vertical"

              verticalAlign="top"

              backgroundColor="white">

       

          <mx:Style>

              PopUpButton {

                  popUpStyleName: myCustomPopUpStyleName;

              }

       

              .myCustomPopUpStyleName {

                  fontWeight: normal;

                  textAlign: left;

              }

          </mx:Style>

       

          <mx:Array id="arr">

              <mx:Object label="Alert" packageName="mx.controls" />

              <mx:Object label="Button" packageName="mx.controls" />

              <mx:Object label="ButtonBar" packageName="mx.controls" />

              <mx:Object label="CheckBox" packageName="mx.controls" />

              <mx:Object label="ColorPicker" packageName="mx.controls" />

          </mx:Array>

       

          <mx:PopUpButton id="popUpButton"

                  label="Click to open..."

                  openAlways="true">

              <mx:popUp>

                  <mx:DataGrid dataProvider="{arr}"

                          draggableColumns="false"

                          rowCount="4"

                          width="300" showHeaders="false" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true">

                      <mx:columns>

                          <mx:DataGridColumn dataField="label"

                                  headerText="Label:" />

                       </mx:columns>

                  </mx:DataGrid>

              </mx:popUp>

          </mx:PopUpButton>

       

      </mx:Application>