3 Replies Latest reply on Aug 3, 2010 10:40 AM by Flex harUI

    DataGrid used in Skin bug




      I have a problem when i use a dataGrid in a skin. The dataGrid bug at runTime, the rows are not clickable anymore(no rollover..), only the headers...

      Do i miss something?


      Here are 3 sample files reproducing the problem :



      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*"
                  import mx.collections.ArrayCollection;
                  import mx.events.FlexEvent;
                  protected function application1_creationCompleteHandler(event:FlexEvent):void
                      var o : Object = new Object();
                      o.a = "a";
                      o.b = "b";
                      var arr : ArrayCollection = new ArrayCollection();
                      for (var i : int = 0; i < 50; i++){
                      testObj.dg = arr;
          <local:test id="testObj" width="100%" height="100%" skinClass="skinn"/>    



      class skinnable :

          import mx.collections.ArrayCollection;
          import spark.components.SkinnableContainer;
          public class test extends SkinnableContainer
              public var dg:ArrayCollection;
              public function test()



      <?xml version="1.0" encoding="utf-8"?>
          Copyright 2008 Adobe Systems Incorporated
          All Rights Reserved.
          NOTICE: Adobe permits you to use, modify, and distribute this file
          in accordance with the terms of the license agreement accompanying it.
      <!--- The default skin class for a Spark SkinnableContainer container.  
           @see spark.components.SkinnableContainer
            @langversion 3.0
            @playerversion Flash 10
            @playerversion AIR 1.5
            @productversion Flex 4
      <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" 
          xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5" xmlns:mx="library://ns.adobe.com/flex/mx">
          <fx:Script fb:purpose="styling">
                   *  @private
                  override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
                      // Push backgroundColor and backgroundAlpha directly.
                      // Handle undefined backgroundColor by hiding the background object.
                      if (isNaN(getStyle("backgroundColor")))
                          background.visible = false;
                          background.visible = true;
                          bgFill.color = getStyle("backgroundColor");
                          bgFill.alpha = getStyle("backgroundAlpha");
                      super.updateDisplayList(unscaledWidth, unscaledHeight);
              <s:State name="normal" />
              <s:State name="disabled" />
          <!--- Defines the appearance of the SkinnableContainer class's background. -->
          <s:Rect id="background" left="0" right="0" top="0" bottom="0">
                  <!--- @private -->
                  <s:SolidColor id="bgFill" color="#FFFFFF"/>
          <!-- the datagrid with problems at runtime !!! -->
          <mx:DataGrid width="100%" height="100%" dataProvider="{hostComponent.dg}"/>
              Note: setting the minimum size to 0 here so that changes to the host component's
              size will not be thwarted by this skin part's minimum size.   This is a compromise,
              more about it here: http://bugs.adobe.com/jira/browse/SDK-21143
          <!--- @copy spark.components.SkinnableContainer#contentGroup -->
          <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" minWidth="0" minHeight="0">


      Thanks for your help !