Skip navigation
Currently Being Moderated

Spark datagrid item renderer - adjust height

Jul 11, 2013 1:11 PM

I am using a textinput as an item renderer for DataGrid:

<s:GridColumn dataField="Comment" headerText="Comment"

                                                                                  itemRenderer="DataGridRenderer">

</s:GridColumn>

 

// Renderer

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

<s:GridItemRenderer 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:gridEditorClasses="spark.components.gridEditorClasses.*"

                                          xmlns:ns="library://commons.stoneriver.com"

 

 

                                >

 

          <fx:Script>

                    <![CDATA[

                              override public function prepare(hasBeenRecycled:Boolean):void

                              {

                                        super.prepare(hasBeenRecycled);

                                        if (data)

                                        {

                                                  if(data.FormCode == "")

                                                  {

                                                            Comment.text = data[column.dataField];

                                                            Comment.setStyle("backgroundColor", 0xFFFFFF);

                                                  }

                                                  else

                                                  {

                                                            Comment.text = "";

                                                            Comment.setStyle("backgroundColor", 0xB1CCF0);

                                                  }

                                        }

                              }

                    ]]>

          </fx:Script>

 

          <!--- The renderer's visual component.          -->

          <s:TextInput id="Comment" width="100%" borderVisible="false" fontSize="{column.grid.dataGrid.getStyle('fontSize')}"/>

</s:GridItemRenderer>

 

How can I adjust a height of this renderer to fill the whole cell? Right now it comes out with a smaller height than a row height.

 

Thanks

 
Replies
  • Currently Being Moderated
    Jul 12, 2013 7:04 AM   in reply to Zolotoj

    Hello.

    Is 'height = "100%"' not working?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 15, 2013 10:48 PM   in reply to Zolotoj

    Hi again. You can try to use property 'variableRowHeight="true"' at list's layout.

     
    |
    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