I think I'm missing something easy here:
I have two different DataGrid on the same view component both using
the same dataprovider, I cannot make second grid (non-editable) to
refresh edited cell in dataprovider to reflect changes made in first
grid (in dataprovider to be strict),
sample code:
mxml:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import data.SampleVO;
[Bindable]
public var initDG:Array = [new SampleVO("peter", true),
new SampleVO("ann", false)];
]]>
</mx:Script>
<!-- first grid -->
<!-- editable -->
<mx:DataGrid dataProvider="{initDG}">
<mx:columns>
<mx:DataGridColumn dataField="firstName"/>
<mx:DataGridColumn dataField="isMod" rendererIsEditor="
true" editable="true"
editorDataField="isSelected">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox selected="{data.isMod}"
click="handleClick()">
<mx:Script>
<![CDATA[
public var
isSelected:Boolean;
private
function handleClick():void{
data.
isMod = this.selected;
isSelected = this.selected;
}
]]>
</mx:Script>
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid >
<!-- second grid -->
<!-- non editable -->
<mx:DataGrid id="secondGrid" dataProvider="{initDG}"/>
</mx:Application>
SampleVO (data.SampleVO.as):
package data
{
[Bindable]
public class SampleVO
{
public function SampleVO(firstName:String, isMod:Boolean){
this.firstName = firstName;
this.isMod = isMod;
}
public var firstName:String;
public var isMod:Boolean;
}
}
thanks for helping with that,
kind regards,
Peter Blazejewicz
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.