0 Replies Latest reply on Aug 28, 2010 4:50 AM by kvanderwende

    DataGrid rendering problem

    kvanderwende

      I have an ApplicationControlBar above a data grid.  The data grid has widths specified and is bound to a data source that is populated by a service call.  The mark up below causes the description column to disappear and the header row is about 10 times taller than it should be.  If I put an empty label inside  the application bar it all loads as expected.  I tried putting an updateComplete handler on the grid but I found two problems.  Adding a trace to the method handler showed that it just kept firing over and over.  It also prevented resize of the grid columns.

       

       

      <mx:VBox

       

       

      height="100%" width="80%" horizontalScrollPolicy="off" verticalScrollPolicy="off">

          

       

      <mx:ApplicationControlBar width="100%" horizontalGap="0" id="docsAppBar">

                

       

      <mx:Button click="browseForDocs()"

                        id="

      docsTabUploadButton"

                        label="

      Upload Document"

                        enabled="

      {MediaManagerModel.activateUploadButton}"/>

          

       

      </mx:ApplicationControlBar>  

          

      <mx:HBox width="100%" height="100%">

                

       

      <mx:DataGrid dataProvider="{tabMediaList}"

                        id="

      docGrid"

                        width="

      100%"

                        height="

      100%"

                        verticalGridLines="

      true"

                        variableRowHeight="

      true"

                        wordWrap="

      true"

                        sortableColumns="

      false"

                        editable="

      false"

                        allowDragSelection="

      true"

                        dragEnabled="

      true"

                        dragMoveEnabled="

      true"

                        dropEnabled="

      true"

                        dragComplete="updateRowPositions()"

                        itemClick="updateCurrentMediaObject()"

                      

      >

                      

       

      <mx:columns>

                            

       

      <mx:DataGridColumn width = "20" id="displayOrderCol" headerText="#"  dataField="displayOrder" labelFunction="MediaManagerModel.getMediaDisplayOrder"/>

                            

       

      <mx:DataGridColumn width = "250" id="mediaNameCol" headerText="File Name" dataField="mediaName" />

                            

       

      <mx:DataGridColumn width = "120" id="mediaTypeCol" headerText="Type"  dataField="mediaType" labelFunction="MediaManagerModel.getMediaTypeDisplay"/>

                            

       

      <mx:DataGridColumn width = "60" id="buyerCol" headerText="Public" dataField="buyer" labelFunction="MediaManagerModel.getPublicDisplay" textAlign="center"/>

                            

       

      <mx:DataGridColumn width = "50" id="mediaSizeCol" headerText="Size" dataField="mediaSize" labelFunction="MediaManagerModel.getMediaSizeDisplay" textAlign="center"/>

                            

      <mx:DataGridColumn width = "90" id="inputDateCol" headerText="Date Added" dataField="inputDate" labelFunction="MediaManagerModel.getMediaInputDateDisplay" textAlign="center"/>

                            

      <mx:DataGridColumn width= "240" id="mediaDescrCol" headerText="Description" dataField="mediaDescr" />         

                      

      </mx:columns>

                

      </mx:DataGrid>

          

      </mx:HBox>

          

      </mx:VBox>

       

      If I add <mx:Label/> inside the ApplicationControlBar everything renders fine.  Any ideas?