4 Replies Latest reply: Jul 15, 2013 10:48 PM by Craberoid RSS

    Spark datagrid item renderer - adjust height

    Zolotoj Community Member

      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