This content has been marked as final. Show 5 replies
I played for a while but I'm not well versed in itemrenderer data being thrown around yet. However, if you haven't noticed, there's a rather new article at the Adobe Developer Center for Flex about itemEditors. Maybe something of use in there.
Nothing new in that article, maybe as the series progresses...
I have a found a hack around this but it's not the way I want to do it. If I add the itemeditend event listener with a very low priority (-100) so it gets executed after flex has already updated the datagrid I can interact directly with the data, instead of the itemeditor/renderer before the data is updated. This means I can't do a preventUpdate() and force the user to correct the input so is not ideal, but it works in this limited application.
I did find this: http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_8.html which has exactly the same case of needing to modify data sent back from an itemeditor. It pokes the modified data back to TextInput(myGrid.itemEditorInstance).text which is the same object as my (event.itemRenderer as TextInput).text. Doesn't work.
I attach my code for anyone else struggling with this. If anyone has a better solution I'd love to see it.
I'll be watching the series too as i'm just getting into itemEditors. I'm wondering if it's best to make a custom itemEditor and use the preventDefault then override the set data function of the superclass. This, I'm betting, is something that Amy or Tracy or one of the other componently-experienced people will be able to answer today because it'll be a challenge.1 person found this helpful
I'm not sure where in the scope chain is but maybe you could use a RegEx validator on the cell and act on the RegExpValidationResult. I agree with you, though, that it's uncomfortable to have to resort to solely lowering priorities or increasing timing as it feels like you're going to run into an instance where it doesn't work.1 person found this helpful
"John Hall" <email@example.com> wrote in message
> I'll be watching the series too as i'm just getting into itemEditors. I'm
> wondering if it's best to make a custom itemEditor and use the
> then override the set data function of the superclass. This, I'm betting,
> something that Amy or Tracy or one of the other componently-experienced
> will be able to answer today because it'll be a challenge.
Sorry, most of what I do with Flex is just displaying. I haven't done that
much with the editing side.