Skip navigation
Kevin Plaul
Currently Being Moderated

Flex 4.3 AdvancedDatagrid Problem

Jul 15, 2013 11:19 PM

Tags: #error #bug #event #key #advanceddatagrid #f8 #strange

Dear Community,

 

i have a strange problem with the AdvancedDatagrid in Flex 4.3. It is a simple Datagrid without any Eventhandler and so on. If i have less Rows i dont have a Problem. But if i have many Datarows (in my case about 2000) and than i press the F key, it selects a row. But why?

 

Now it comes really strange:

 

if a add an eventhandler that listen to the F8 Key, the Datagrid selects any Row BEFORE it throws my added event.

 
Replies
  • Currently Being Moderated
    Jul 16, 2013 3:37 AM   in reply to Kevin Plaul

    Hi,

    Can you share a sample code?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2013 6:56 AM   in reply to Kevin Plaul

    Kevin,

    I would like to see more of your code, no data.

    Best,

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2013 8:40 AM   in reply to Kevin Plaul

    I don't have flex 4.3 anymore, i am using Flash builder 4.7 with SDK 4.5.1.

    Try taking out selectionMode="singleRow" and designViewDataType="flat"

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2013 4:16 AM   in reply to Kevin Plaul

    Here is my solution:

     

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

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                   xmlns:s="library://ns.adobe.com/flex/spark"

                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()">

        <fx:Declarations>

            <!-- Place non-visual elements (e.g., services, value objects) here -->

        </fx:Declarations>

        <fx:Script>

            <![CDATA[

                import mx.collections.ArrayCollection;

                import mx.controls.Alert;

     

                [Bindable]

                private var dpFlat:ArrayCollection = new ArrayCollection([

                    {Territory:"Arizona", Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000},

                    {Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, 

                    {Territory:"Central California", Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, 

                    {Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, 

                    {Territory:"Northern California", Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000},

                    {Territory:"Northern California", Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, 

                    {Territory:"Southern California", Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000},

                    {Territory:"Southern California", Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}

                ]);

     

                private function init():void{

                    myADG.addEventListener(KeyboardEvent.KEY_UP, keyHandler );

                }

     

                private function keyHandler(event:KeyboardEvent):void{

                    if (event.keyCode == 119 && event.charCode == 0)

                        Alert.show ("F8 key");

                }

            ]]>

        </fx:Script>

        <mx:AdvancedDataGrid id="myADG" editable="false" width="100%" height="100%" dataProvider="{dpFlat}"

                             sortExpertMode="true"

                             designViewDataType="flat"

                             selectionMode="singleRow" >

     

        </mx:AdvancedDataGrid>

    </s:Application>

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2013 6:42 AM   in reply to Kevin Plaul

    Did you actually try my code?

    If you have other issue please add you code to this example because I don't understand your issue.

    Best,

     
    |
    Mark as:

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