1 Reply Latest reply on Apr 22, 2011 5:27 AM by andres margalef

    AdvancedDataGrid: invalid focus border on itemEditorInstance

    andres margalef

      The focus border of the itemEditorInstance has an offset from the itemEditorInstance component. The border has an offset equal to the button height. How can i fix that.

       

      NewGrid.mxml

       

      <?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"

      xmlns:local="*"

       

      width="100%" height="100%"

      >

       

      <local:Grid editable="true">

      <local:dataProvider>

      <fx:Object name1="name1" name2="name2" />

      <fx:Object name1="name1" name2="name2" />

      <fx:Object name1="name1" name2="name2" />

      <fx:Object name1="name1" name2="name2" />

      <fx:Object name1="name1" name2="name2" />

      </local:dataProvider>

      <local:columns>

      <mx:AdvancedDataGridColumn dataField="name1" editable="true"/>

      <mx:AdvancedDataGridColumn dataField="name2" editable="true"/>

      </local:columns>

      </local:Grid>

       

      </s:Application>

      Grid.mxml
      <?xml version="1.0" encoding="utf-8"?>
      <mx:AdvancedDataGrid
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      >
      <fx:Script>
      <![CDATA[
      import mx.controls.Button;
      private var headerButton:Button;
      private static const HEADER_BUTTON_HEIGHT:int = 50;
      override protected function createChildren():void {
      super.createChildren();
      headerButton = new Button();
      headerButton.label = "header button";
      headerButton.height = HEADER_BUTTON_HEIGHT;
      addChild(headerButton);
      }
      override protected function adjustListContent(unscaledWidth:Number=-1, unscaledHeight:Number=-1):void {
      super.adjustListContent(unscaledWidth, unscaledHeight);
      headerButton.width = unscaledWidth;
      headerButton.move(listContent.x, 0);
      listContent.setActualSize(listContent.width, listContent.height - headerButton.height);
      listContent.move(listContent.x, listContent.y + headerButton.height);
      }
      ]]>
      </fx:Script>
      </mx:AdvancedDataGrid>