Stuck with GridItemRenderer


here problem. have s:griditemrenderer (the spark datagrid size use this, is: 100% x 100%) , here function in it:

override public function prepare(hasbeenrecycled:boolean):void {
    mylabel
.text = width.tostring();
}

and here "mylabel" in it:

<s:label id="mylabel" x="0" y="0" width="100%" height="20" paddingbottom="0" paddingleft="0" paddingright="0" paddingtop="0"/>

so , problem is:

when drag side of window, , resize fine! mylabel updating, last column doesn't. when maximize window, nothing happend, "width" variable updated, mylabel.text doesn't. (so try use this.width too, isn't take effects)

the solution think (this me, think this?):

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

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

                                                  clipandenablescrolling="true"

                                                  resize="griditemrenderer1_resizehandler(event)">

          <fx:script>

                    <![cdata[

                              import mx.events.resizeevent;

 

                              override public function prepare(hasbeenrecycled:boolean):void {

                                        lbl.text = column.grid.getcolumnwidth(column.columnindex).tostring();

                              }

 

                              protected function griditemrenderer1_resizehandler(event:resizeevent):void {

                                        column.grid.validatenow();

                              }

 

                    ]]>

          </fx:script>

          <s:label id="lbl" x="0" y="0" width="100%" height="40" backgroundcolor="#fa8888"/>

</s:griditemrenderer>



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

PProHeadless.exe has stopped working error when opening projects in Adobe Media Encoder CS6

Preconditions Failed. - Joomla! Forum - community, help and support