There it was :-) .. thanks a lot Alex.

Just in case anyone has the similar problems, my itemEditEnd listener looks
like this now:

   /**
    * Called when the user has edited an answer
    */
   private function onAnswerEditEnd(ev:DataGridEvent):void
   {
    var answerGrid:DataGrid = DataGrid(ev.target);
    var ans:Answer = answerGrid.selectedItem as Answer;
    ans.answer.text = TextInput(answerGrid.itemEditorInstance).text;
    ev.preventDefault();         // make sure the event doesn't reach the
datagrid
    this.answerGrid.destroyItemEditor();     // stop editing
   }

2008/5/20 Alex Harui <[EMAIL PROTECTED]>:

>    itemEditorInstance.text?
>
>  ------------------------------
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *bjorn -
> *Sent:* Tuesday, May 20, 2008 8:41 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] Problem editing custom object in DataGrid
> (itemEditEnd method, cannot get data)
>
>    Hi, I've created a MultiLanguageString object which contain an array of
> language codes and text value (e.g. [en] => Hello, [de] => "Guten tag" etc.)
>
> When editing in a DataGrid you always see the current selected language
> since MultiLanguageString's toString() method returns the internal arr[
> currentLanguageCode ] text.
>
> However, on edit end I got this error saying String cannot be converted to
> MultiLanguageString (Type Coercion failed), so I figgured I'd have to create
> my own itemEditEnd listener and prevent the vent from reaching the dataGrid
> there.
>
> This works fine.
>
> However, I'm unable to get the data somehow (all I get is the original
> data, unedited) .. I see DataGrid uses the event.itemRenderer.data, but when
> I look that up I only see the old data. Same for all other properties on the
> event which contains the data.
>
> Should I take a different route here or is it solvable this way?
>
>
> --
>
> ========================
> http://www.juicability.com - flex blog
> http://www.43min.com - funny movies
>
>  
>



-- 

========================
http://www.juicability.com - flex blog
http://www.43min.com - funny movies

Reply via email to