[flexcoders] checkbox itemEditor in DataGrid

2009-01-30 Thread markflex2007
Hi,

I have add a checkbox itemEditor in DataGrid, I want to make current
row selected when I select the checkbox.

Please give me a deal how to do that.

Thanks you for your help

Mark

my current code 

mx:DataGrid x=531 y=273 editable=true dataProvider={inventoryDB}
mx:DataGridColumn headerText=Selection dataField=mySelectin 
 labelFunction=selectLabeler itemEditor=mx.controls.CheckBox
editorDataField=selected width=80/
  /mx:DataGrid
 
 private function selectLabeler( item:Object, col:* ) : String
 {
if(item.mySelectin == ){
  item.mySelectin = false;
   }
return item.mySelectin ? Yes : Not;
}



RE: [flexcoders] checkbox itemEditor in DataGrid

2009-01-30 Thread Tracy Spratt
Have the renderer dispatch a bubbling event on change of the checkbox.
In the handler, you can access the item, and get the item index and the
checked state.  Use that to set the selectedIndex on the DataGrid.

 

Of course the usual itemRenderer recycling caveats apply.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of markflex2007
Sent: Friday, January 30, 2009 10:42 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] checkbox itemEditor in DataGrid

 

Hi,

I have add a checkbox itemEditor in DataGrid, I want to make current
row selected when I select the checkbox.

Please give me a deal how to do that.

Thanks you for your help

Mark

my current code 

mx:DataGrid x=531 y=273 editable=true
dataProvider={inventoryDB}
mx:DataGridColumn headerText=Selection dataField=mySelectin 
labelFunction=selectLabeler itemEditor=mx.controls.CheckBox
editorDataField=selected width=80/
/mx:DataGrid

private function selectLabeler( item:Object, col:* ) : String
{
if(item.mySelectin == ){
item.mySelectin = false;
}
return item.mySelectin ? Yes : Not;
}

 



[flexcoders] CheckBox itemEditor in DataGrid behaves erratic

2006-10-11 Thread iko_knyphausen



This one is really odd...
I have a DataGrid, which has the selectedItem of another grid (parent-grid)as a dataProvider. The "child"-grid hasa checkbox control as renderer and editor.It does perform nicely in the sense that when I change the selection of the "parent"-grid,all sub-records with selected boxes (data is set to "true") appear as expected, i.e. checked. 
Now, when Icheck/uncheck items inthe child-list the data bound to the parent-grid seems to get "mixed up" (checked items of this and other child-records thereafterappear checked or uncheckedat random). The odd thing is, if I change the renderer to TextInput and edit the checkbox itemsas texts ("true" and "false"), everything is honkey-dory and remains that way.
Here the 2 variants of the grid column in question. First as TEXTINPUT which works fine...
mx:DataGridColumn editable="true" itemRenderer="mx.controls.TextInput" editorDataField="text" rendererIsEditor="true" width="65" headerText="Member" dataField="member" textAlign="center" /
And here with a checkbox control that creates the issue...
mx:DataGridColumn editable="true" itemRenderer="mx.controls.CheckBox" editorDataField="selected" rendererIsEditor="true" width="65" headerText="Member" dataField="member" textAlign="center" /
Any ideas... ?Likethe aliens in Toy Story "I will be eternally grateful" for your advise ;-)
Still having fun, though...

__._,_.___





--
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
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___