I've marked your issue for further investigation, but am backlogged this week.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of carl_steinhilber Sent: Thursday, December 06, 2007 10:35 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Using DateField as itemEditor for DataGrid column Anybody? Anybody? Various other namespaces seem to have definitions for date values, but I haven't been successful in loading up other namespaces in XML docs for Flex consumption. And I'm not convinced it would work even if I did... seems like the date value would *still* need to be in a format that Flex could understand internally, not based on some other namespace that it knows nothing about. ANY help would be appreciated. Thanks, -Carl --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "carl_steinhilber" <[EMAIL PROTECTED]> wrote: > > Hi Alex, > > Sure. (Holiday-themed) example below. :-) XML inline, of course, > rather than loaded from external doc as in my final app. As is, it > works (all data is shown, and clicking in the date field opens the > DateField editor... there's a coercion error on click in debug, but > it's silent when not in debug). > > Changing the "date" DataGridColumn to > <mx:DataGridColumn headerText="Date" dataField="date" > width="100" editable="true" > itemRenderer="mx.controls.DateField" > editorDataField="selectedDate" rendererIsEditor="true" /> > > prevents any data from being shown. In debug, the coercion error > occurs immediately on creation... which makes perfect sense. > > So the issue is definitely that Flex can't parse the date from the XML > node. But I'm at a loss as to how to define the date in the XML to fix > the problem. Am I going to have to step through the XML and convert it > to an Object, converting the date along the way? Or is there a more > straight-forward solution I'm missing? Would there be a way to wrap > the DateField in a custom renderer that can convert the date on the fly? > > > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> " > layout="vertical" creationComplete="init()" > > <mx:Script> > <![CDATA[ > import mx.collections.XMLListCollection; > > [Bindable] > private var xmlChristmas:XMLListCollection; > > private function init():void > { > xmlChristmas = new > XMLListCollection(xmlDaysOfChristmas.day.copy()); > } > > private var xmlDaysOfChristmas:XML = > <root> > <day> > <name>First Day of Christmas</name> > <date>2007-12-25T00:00:00.0000000-05:00</date> > <gift>Partridge in a pear tree</gift> > </day> > <day> > <name>Second Day of Christmas</name> > <date>12/26/2007</date> > <gift>Two turtle doves</gift> > </day> > <day> > <name>Third Day of Christmas</name> > <date>Thu Dec 27 00:00:00 GMT-0800 2007</date> > <gift>Three french hens</gift> > </day> > </root>; > ]]> > </mx:Script> > > <mx:DataGrid id="dgOutput" dataProvider="{xmlChristmas}" > width="600" height="160" editable="true"> > <mx:columns> > <mx:DataGridColumn headerText="Name" dataField="name" > width="200" editable="true" /> > <mx:DataGridColumn headerText="Date" dataField="date" > width="100" editable="true" > itemEditor="mx.controls.DateField" > editorDataField="selectedDate" /> > <!-- mx:DataGridColumn headerText="Date" dataField="date" > width="100" editable="true" > itemRenderer="mx.controls.DateField" > editorDataField="selectedDate" rendererIsEditor="true" / --> > <mx:DataGridColumn headerText="Gift" dataField="gift" > width="300" editable="true" /> > </mx:columns> > </mx:DataGrid> > </mx:Application> > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote: > > > > Can you post a mini-example? > > > > > > > > ________________________________ > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > > Behalf Of carl_steinhilber > > Sent: Sunday, December 02, 2007 11:43 PM > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Using DateField as itemEditor for DataGrid column > > > > > > > > > > I'm having a problem using a DateField as a itemRenderer/editor for a > > column in a dataGrid. > > > > If I set the DateField as my itemEditor, everything works perfectly. > > But if I set the DateField as my itemRenderer and set rendererIsEditor > > to true the dataGrid renders completely blank (no data in *any* field) > > and locks down so *nothing* is editable. > > > > In reading posts in the archives in this group and elsewhere, folks > > with similar issues were told to make sure the data bound to the > > column is of type date. > > But I have two issues with that: > > 1) if it wasn't understood as being of type date, why would it work > > when the dateField was set as the itemEditor > > and > > 2) I'm loading in the dataProvider for the DataGrid as a Bindable > > XMLListCollection from an external XML file... and I'm not sure how I > > can designate in XML that the node is of type date. > > > > Anyone have any info or pointers? They'd be greatly appreciated. > > > > Thanks in advance! > > -Carl > > >