Flex中如何通过rowCount属性,动态改变DataGrid显示行数

<iframe src="http://blog.minidx.com/ext05/resizing-a-flex-datagrid-control-using-the-rowcount-property/main.html" width="550" height="380"></iframe>

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
  3. layout="vertical"
  4. verticalAlign="top"
  5. backgroundColor="white">
  6. <mx:Arrayid="arr">
  7. <mx:Objectcol1="1" col2="A" col3="a" />
  8. <mx:Objectcol1="2" col2="B" col3="b" />
  9. <mx:Objectcol1="3" col2="C" col3="c" />
  10. <mx:Objectcol1="4" col2="D" col3="d" />
  11. <mx:Objectcol1="5" col2="E" col3="e" />
  12. <mx:Objectcol1="6" col2="F" col3="f" />
  13. </mx:Array>
  14. <mx:ApplicationControlBardock="true">
  15. <mx:Form>
  16. <mx:FormItemlabel="rowCount:">
  17. <mx:HSliderid="slider"
  18. minimum="0"
  19. maximum="{arr.length+1}"
  20. value="4"
  21. liveDragging="true"
  22. snapInterval="1"
  23. tickInterval="1"
  24. dataTipPrecision="0"/>
  25. </mx:FormItem>
  26. </mx:Form>
  27. </mx:ApplicationControlBar>
  28. <mx:DataGridid="dataGrid"
  29. dataProvider="{arr}"
  30. rowCount="{slider.value}"/>
  31. </mx:Application>

你可能感兴趣的:(C++,c,Flex,C#,Adobe)