2009-11-18 64 views
0

我有一個DataGridDatagrid的scolling問題 - Flex的

<mx:DataGrid styleName="alternateColor" 
    verticalScrollBarStyleName="verticalScrollStyle" 
    headerSeparatorSkin="uiExtensions.DataGridHeaderSeparators" 
    width="100%" height="100%" editable="false" color="#000000" 
    verticalGridLines="false" variableRowHeight="true" 
    itemEditEnd="processData(event);" sortableColumns="false"> 

    <mx:columns> 
     <mx:DataGridColumn wordWrap="true" dataField="Name"> 
      <mx:itemRenderer> 
       <mx:Component> 
        <mx:Box> 
         <mx:Text id="tbName" selectable="false" 
          width="100%" fontSize="12" text="{data.Name}"/> 
         <mx:Text id="tbcontact" selectable="false" 
          width="100%" text="{data.Contact}"/> 
        </mx:Box> 
       </mx:Component> 
      </mx:itemRenderer> 
     </mx:DataGridColumn> 
    </mx:columns> 
</mx:DataGrid> 

我在一個的DataGridColumn添加2個文本組件後,DataGrid不向下滾動。

滾動條滾動備份上拉下來。

感謝任何幫助。

謝謝。

回答

0

問題解決了,

我用了一個垂直框和標籤,而不是在上面貼的代碼框和文本標籤。

現在我的代碼看起來像這樣...

    <mx:Component> 
        <mx:VBox horizontalGap="0" verticalGap="0"> 
         <mx:Label id="tbclassified" selectable="true" width="100%" fontSize="11" text="{data.Classified}"/> 
         <mx:HBox horizontalGap="0" verticalGap="0"> 
          <mx:Label id="tbcategory" textAlign="left" selectable="true" width="100%" fontStyle="italic" color="#9F2200" text="{data.ClassifiedCategory}"/> 
          <mx:Label id="tbcontact" textAlign="right" selectable="true" width="100%" text="{data.Name} - {data.Contact}"/> 
         </mx:HBox> 
        </mx:VBox> 
       </mx:Component> 
0

滾動以DataGrid啓用時對電網的高度不足以顯示其數據提供的所有項目;而不是在向列中添加更多控件時。您剛剛定義了一個具有兩個Text控件的單列數據網格。指定一個足夠大的數據網格的dataProvider,它會工作。

順便說一下,你爲什麼使用Box控件而不是HBoxVBox

+0

感謝您的回覆Amarghosh ..我打算在DataGrid中,其中有兩個文本控件只有一列......我已經得到了各地DataProvider中有20行,並出現一個垂直滾動條。問題是當我嘗試拖動滾動條時。釋放鼠標按鈕時,滾動條位置本身處於其初始位置。 – Immanuel 2009-11-19 10:00:57

+0

此外,關於我用「盒子」控制,我正好粘貼代碼時,我只是想,如果該控件幫助。我現在使用的一個「垂直框」控制... – Immanuel 2009-11-19 10:05:41

+0

發表最小的應用程序演示的錯誤 - 用數據。 – Amarghosh 2009-11-19 10:59:20