问一个有关MecGrid的问题,在线等

Tony8002003 2010-02-01 04:08:04
两个MecGrid,第一个MecGrid是可编辑的。第二个MecGrid放的是checkBox。都是显示一列
我的问题是如果第一个MecGrid的单元格在编辑的状态下,当我选中第二个MecGrid里的checkBox,使第一个MecGrid的单元格在编辑的状态下变成不可编辑的?
在线等。
...全文
174 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tony8002003 2010-03-08
  • 打赏
  • 举报
回复
恩,好的, 谢谢楼上,这就看看
syeia 2010-03-08
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
minWidth="1024"
minHeight="768">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.CheckBox;
[Bindable]
private var ac:ArrayCollection=new ArrayCollection([{value: "", edit: true, chk: false}, {value: "", edit: true, chk: false}, {value: "", edit: true, chk: false}, {value: "", edit: true, chk: false}, {value: "", edit: true, chk: false}, {value: "", edit: true, chk: false}]);

public function fun(chk:CheckBox):void
{
var obj:Object=dg2.selectedItem;
var nInd:int=dg2.selectedIndex;
ac.removeItemAt(nInd);
if (!chk.selected)
{
obj.edit=true;
}
else
{
obj.edit=false;
}
ac.addItemAt(obj, nInd);

}
]]>
</mx:Script>
<mx:DataGrid x="112"
id="dg1"
dataProvider="{ac}"
y="140">
<mx:columns>
<mx:DataGridColumn headerText="Column 1"
dataField="col1">
<mx:itemRenderer>
<mx:Component>
<mx:TextInput editable="{data.edit}"
text="{data.value}"
change="textinput1_changeHandler(event,this)">
<mx:Script>
<![CDATA[
import mx.controls.TextInput;

protected function textinput1_changeHandler(event:Event, txt:TextInput):void
{
data.value=txt.text;
}
]]>
</mx:Script>
</mx:TextInput>

</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<mx:DataGrid x="511"
id="dg2"
dataProvider="{ac}"
y="153">
<mx:columns>
<mx:DataGridColumn headerText="Column 1"
dataField="col1">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox label="aaaaaa"
click="parentDocument.fun(this)"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>

</mx:Application>


没用过 MecGrid, 看有没有用?
syeia 2010-03-08
  • 打赏
  • 举报
回复
贴出来看看
贴出来看看
贴出来看看
crazylaa 2010-02-01
  • 打赏
  • 举报
回复
不会。
在线路过
Tony8002003 2010-02-01
  • 打赏
  • 举报
回复
MecGrid有没有只让某一列刷新?

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧