6 Replies Latest reply on Aug 24, 2011 7:54 AM by Daniel Pride

    Spark datagrid item editor font see through

    Daniel Pride Level 1

      I am using a default item editor on a spark datagrid.

      When the user attempts to edit the field the old value shows through.

      How do I get rid of this?

      I am using out of the box stuff? Is this a listed bug?

      Code is...

      <s:GridColumn dataField="Actual" headerText="Actual" width="75" editable="true">
                          <s:itemRenderer>
                              <fx:Component>
                                  <s:DefaultGridItemRenderer textAlign="right"   background="true" backgroundColor="#FFFFFF" alpha="1.0" color="#000000" />
                              </fx:Component>
                          </s:itemRenderer>
          </s:GridColumn>

      Thanks

      Dan Pride

        • 1. Re: Spark datagrid item editor font see through
          Don Kerr Level 3

          Try <s:DefaultGridItemEditor if you are wanting to make it editable.

           

           

          here is an example of combobox, but it is similiar ....

           

          <s:itemEditor>

          <fx:Component>

          <s:ComboBoxGridItemEditor  >

          <s:dataProvider>

          <s:ArrayList>

          <fx:String>Edit</fx:String>

          <fx:String>Read</fx:String>

          </s:ArrayList>

          </s:dataProvider>

          </s:ComboBoxGridItemEditor>

          </fx:Component>

          </s:itemEditor>

           

           

          Don

          • 2. Re: Spark datagrid item editor font see through
            Daniel Pride Level 1

            Oops, been trying all sorts of combinations.

            That does not work either, neither does including both a renderer and and editor like the following. what I am trying to do is have one cell/column white that is editable and the rest a darker color. But no matter what I do this seems to result in the visual artifact of the editing number over the original. There is not background color or alpha on the editor that I can set to cover it over apparently and it needs one ???

                 <s:GridColumn dataField="Actual" width="75" editable="true">

                 <s:itemRenderer>

                      <fx:Component>

                           <s:DefaultGridItemRenderer textAlign="right"   background="true" backgroundColor="#FFFFFF" alpha="1.0" color="#000000" />

                 </fx:Component>

            </s:itemRenderer>

            <s:itemEditor>

                 <fx:Component>

                      <s:DefaultGridItemEditor textAlign="right" alpha="1.0" chromeColor="#FFFFFF" />

                 </fx:Component>

            </s:itemEditor>

            </s:GridColumn>

             

             

             

            Dan Pride

            • 3. Re: Spark datagrid item editor font see through
              TopherCantrell

              Hi Daniel,

               

              I may be misunderstanding your problem. Forgive me if I missed your point.

               

              I tried your renderers in a Spark DataGrid. The value that I "see through" is the editor showing me the old value to edit. If you want to start the editing with a blank value (and not edit the old value) then you can override the editor's "set value" method to do nothing. This has the undesirable effect of clearing the cell if the user doesn't enter anything. Here is what I am talking about.

               

              Hope this helps.

               

              <s:GridColumn dataField="Actual" width="75" editable="true">

               

                  <s:itemRenderer>

                      <fx:Component>

                          <s:DefaultGridItemRenderer textAlign="right" background="true" backgroundColor="#FFFFFF" alpha="1.0" color="#000000" />

                      </fx:Component>

                  </s:itemRenderer>

               

                  <s:itemEditor>

                      <fx:Component>

                          <s:DefaultGridItemEditor>

                              <fx:Script>

                                  <![CDATA[

                                      override public function set value(newValue:Object):void

                                      {

                                          // Do nothing (leave blank)

                                      }                                       

                                  ]]>

                              </fx:Script>

                          </s:DefaultGridItemEditor>

                      </fx:Component>

                  </s:itemEditor>

               

              </s:GridColumn>

               

              1 person found this helpful
              • 4. Re: Spark datagrid item editor font see through
                JB Ryu

                You can use "opaqueBackground" to set a specific background color. In the following example, I use wihite color to set the background color of GridItemEditor.

                 

                <s:GridItemEditor xmlns:fx="http://ns.adobe.com/mxml/2009"
                                  xmlns:s="library://ns.adobe.com/flex/spark"
                                  xmlns:mx="library://ns.adobe.com/flex/mx"
                                  clipAndEnableScrolling="true"

                                  opaqueBackground="#FFFFFF"
                                  currentState="default">

                • 5. Re: Spark datagrid item editor font see through
                  TopherCantrell Level 1

                  This continued to pester me. Then I did the smart thing and looked at the source for "ComboBoxGridItemEditor.mxml", which is the combo-box editor. I learned all kinds of things I wasn't doing.

                   

                  And here is how they "blank out" the cell underneath (straight from their code):

                   

                     <s:Rect id="bgRect" top="1" left="1" bottom="1" right="1">

                          <s:fill>

                              <!--- @private

                                  Defines the color of the background.

                                  @default 0xFFFFFF

                   

                                  @langversion 3.0

                                  @playerversion Flash 10

                                  @playerversion AIR 2.5

                                  @productversion Flex 4.5

                              -->

                              <s:SolidColor id="bgFill" color="0xFFFFFF" />

                          </s:fill>

                      </s:Rect>

                  • 6. Re: Spark datagrid item editor font see through
                    Daniel Pride Level 1

                    Yes, I also discovered I had entered a background alpha of 0.0 on the external style sheet and forgotten it

                    Dan Pride