浏览 1547 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-07-02
最后修改:2009-12-25
后来想我可以继承它然后对里面的属性再进行设置, 嗯,是个好办法,现在就动手来做. 先写个as package com.hurlant.util {[color=red]//包名改成自己的[/color] import mx.controls.FileSystemDataGrid; import mx.controls.dataGridClasses.DataGridColumn; public class MyFileSystemDataGrid extends FileSystemDataGrid { public function MyFileSystemDataGrid() { super(); } /** *重写父类的方法,然后对 nameColumn.width重新赋值. * */ override protected function childrenCreated():void { super.childrenCreated(); nameColumn.width = 300; } } } 然后再写个测试文件 <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication width="1024" height="900" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.hurlant.util.*"> <!--新定义的 --> <ns1:MyFileSystemDataGrid x="56" y="140"/> <!--系统自带的 --> <mx:FileSystemDataGrid x="56" y="437" /> </mx:WindowedApplication> 好了,看下效果吧, 下面那个是系统自带的,上面那个是新写的 ![]() 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |