|
this is a bit simplier example of reusable
renderer/editor
package
com.theriabook.controls
{ import mx.controls.DateField import mx.controls.dataGridClasses.DataGridListData; import mx.controls.listClasses.ListData; public class DateField extends
mx.controls.DateField
{ private function checked (val : Object):Date { if (val is String) return new Date(Date.parse(val as String)) else return val as Date } override public function set
data(value:Object):void {
if (listData && listData is DataGridListData) value[DataGridListData(listData).dataField] = checked(value[DataGridListData(listData).dataField]); else if (listData is ListData && ListData(listData).labelField in data) value[ListData(listData).labelField] = checked(value[ListData(listData).labelField]); super.data = ""> } } } The usage case:
<mx:DataGridColumn dataField="EndEval" editable="true" width="100"
headerWordWrap="true" headerText="End Evaluation" rendererIsEditor="true" itemRenderer="com.theriabook.controls.DateField"/> Regards,
Anatole Tartakovsky
__._,_.___
SPONSORED LINKS
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 __,_._,___ |
- [flexcomponents] subclassing DateField controls barry.beattie
- Re: [flexcomponents] subclassing DateField contro... Barry Beattie
- Re: [flexcomponents] subclassing DateField co... Anatole Tartakovsky
- Re: [flexcomponents] subclassing DateFiel... Barry Beattie
- Re: [flexcomponents] subclassing Date... Anatole Tartakovsky
