Thanks Jim !
you did it again (solved my problem). [i'm in the uk so you'll
probably get my responses a day later]
To give you a brief idea of what i'm doing. My boss wanted a
universal cellrenderer which gives a differnt cellEditor control
depending on the type of data the DatagridColumn is showing (eg some
are TextInput, some are comboboxes, checkboxes etc).
I had a universal cellrenderer based on Ali's combobox cellrenderer
with more controls.... but it was so sluggish to render.
With the cellrenderer approach (which is absolutely fine) you cant
really pass any extra parameters like editable=false|true.
So what i do instead is i add these extra parameters as extra
attributes to my extended datagridcolumn (Dirk Eismann uses this
idea) eg
<lx:myDataGridColumn columnName="DATECOL" cell="combo"
celleditable="true" etc /> you get the idea.
then in the setFocusedCell() function i can get hold of the
attributes via the 'col' variable and create the appropriate
cellEditor e.g.
if(col.cell == "combo")
cellEditor = listContent.createClassObject(myCombo, etc, etc, etc,
{all my extra parameters});
i also add
cellEditor.addEventListener("focusOut"), "change" etc....so i do
some validation on the data the user enters.
Now, because myCombo, myTextInput all have a <mx:Validator> tag, i
can get that lovely red box+error message (as long as i remain
focused on the cellEditor)
BTW the validation i apply isn't just primary validation (like
maxchars, restrict etc) some of the validation is asynchronous so i
use setInterval before i focus on the next cell .... i actually
override a few other methods in Datagrid.as.
please feel free to ask few other questions.
regards
bod (bhaq1972)
--- In [email protected], Jim Laing <[EMAIL PROTECTED]> wrote:
> On 5/9/05, Jim Laing <[EMAIL PROTECTED]> wrote:
> > I'm not able to replicate your problem.
>
> AHHH! Spoke too soon again! That's twice in one day ... I can, in
> fact, replicate the problem. I did it wrong before ....
>
> However, not only can I replicate your problem, I can also fix it
> (this is a hack cause I did it quick, but you get the idea):
Overload
> the disposeEditor() function and make it destroy the dropdown movie
> clip. See the code attached.
>
> I'm still interested in what your requirements are cause my
solution
> might be more general, if it is applicable (the idea of removing
the
> combobox dropdown comes it ... via MM support).
>
> Jim
>
> function disposeEditor() : Void {
> cellEditor.dropdown.removeMovieClip();
> cellEditor.mask.removeMovieClip();
> super.disposeEditor();
> }
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/