You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2013/10/04 17:01:17 UTC

DataGrid custom property and item renderers

Can someone verify that the following scenario should work?

Spark DataGrid is extended and has a property test:String.
Two custom item renderers check that property and if it's not set set it.
if (myDataGrid(column.grid.dataGrid).test == "")
    myDataGrid(column.grid.dataGrid).test = column.dataField;

What I see is that both columns would have test property empty event though
going thru debugger it's clear that it goes into one renderer then into
another. So, why would second one still has this property not set?

Thanks

Re: DataGrid custom property and item renderers

Posted by mark goldin <ma...@gmail.com>.
No, test value needs to be outside of a renderer.


On Fri, Oct 4, 2013 at 12:02 PM, João Fernandes <
joaopedromartinsfernandes@gmail.com> wrote:

> Why not simply create a ClassFactory for your itemRenderer instead? You
> won't require to extend datagrid and just need to create a custom
> ItemRenderer.
>
> gridColumn itemRenderer="{customItemRendererFactory}"
>
> being customItemRendererFactory
> cf= new ClassFactory(SomeCustomItemRenderer)
> cf.properties ={ test: "someValue};
> customItemRendererFactory = cf;
>
> João Fernandes
>
>
> On 4 October 2013 17:37, mark goldin <ma...@gmail.com> wrote:
>
> > More on that. It looks like when I check for test property in prepare
> > function it's null (expected an empty string) and if I try setting it up
> to
> > a value the Expressions window briefly shows "penging" for test value and
> > then quickly gets back to null. I am not sure I understand what's going
> on.
> >
> >
> > On Fri, Oct 4, 2013 at 10:17 AM, mark goldin <ma...@gmail.com>
> > wrote:
> >
> > > I do callLater from prepare to update this property.
> > >
> > >
> > > On Fri, Oct 4, 2013 at 10:14 AM, Maurice Amsellem <
> > > maurice.amsellem@systar.com> wrote:
> > >
> > >> In what method do you make the check in the custom  itemRenderer ?
> > >>
> > >> -----Message d'origine-----
> > >> De : mark goldin [mailto:markzolotoy@gmail.com]
> > >> Envoyé : vendredi 4 octobre 2013 17:01
> > >> À : users
> > >> Objet : DataGrid custom property and item renderers
> > >>
> > >> Can someone verify that the following scenario should work?
> > >>
> > >> Spark DataGrid is extended and has a property test:String.
> > >> Two custom item renderers check that property and if it's not set set
> > it.
> > >> if (myDataGrid(column.grid.dataGrid).test == "")
> > >>     myDataGrid(column.grid.dataGrid).test = column.dataField;
> > >>
> > >> What I see is that both columns would have test property empty event
> > >> though going thru debugger it's clear that it goes into one renderer
> > then
> > >> into another. So, why would second one still has this property not
> set?
> > >>
> > >> Thanks
> > >>
> > >
> > >
> >
>
>
>
> --
>
> João Fernandes
>

Re: DataGrid custom property and item renderers

Posted by João Fernandes <jo...@gmail.com>.
Why not simply create a ClassFactory for your itemRenderer instead? You
won't require to extend datagrid and just need to create a custom
ItemRenderer.

gridColumn itemRenderer="{customItemRendererFactory}"

being customItemRendererFactory
cf= new ClassFactory(SomeCustomItemRenderer)
cf.properties ={ test: "someValue};
customItemRendererFactory = cf;

João Fernandes


On 4 October 2013 17:37, mark goldin <ma...@gmail.com> wrote:

> More on that. It looks like when I check for test property in prepare
> function it's null (expected an empty string) and if I try setting it up to
> a value the Expressions window briefly shows "penging" for test value and
> then quickly gets back to null. I am not sure I understand what's going on.
>
>
> On Fri, Oct 4, 2013 at 10:17 AM, mark goldin <ma...@gmail.com>
> wrote:
>
> > I do callLater from prepare to update this property.
> >
> >
> > On Fri, Oct 4, 2013 at 10:14 AM, Maurice Amsellem <
> > maurice.amsellem@systar.com> wrote:
> >
> >> In what method do you make the check in the custom  itemRenderer ?
> >>
> >> -----Message d'origine-----
> >> De : mark goldin [mailto:markzolotoy@gmail.com]
> >> Envoyé : vendredi 4 octobre 2013 17:01
> >> À : users
> >> Objet : DataGrid custom property and item renderers
> >>
> >> Can someone verify that the following scenario should work?
> >>
> >> Spark DataGrid is extended and has a property test:String.
> >> Two custom item renderers check that property and if it's not set set
> it.
> >> if (myDataGrid(column.grid.dataGrid).test == "")
> >>     myDataGrid(column.grid.dataGrid).test = column.dataField;
> >>
> >> What I see is that both columns would have test property empty event
> >> though going thru debugger it's clear that it goes into one renderer
> then
> >> into another. So, why would second one still has this property not set?
> >>
> >> Thanks
> >>
> >
> >
>



-- 

João Fernandes

Re: DataGrid custom property and item renderers

Posted by mark goldin <ma...@gmail.com>.
More on that. It looks like when I check for test property in prepare
function it's null (expected an empty string) and if I try setting it up to
a value the Expressions window briefly shows "penging" for test value and
then quickly gets back to null. I am not sure I understand what's going on.


On Fri, Oct 4, 2013 at 10:17 AM, mark goldin <ma...@gmail.com> wrote:

> I do callLater from prepare to update this property.
>
>
> On Fri, Oct 4, 2013 at 10:14 AM, Maurice Amsellem <
> maurice.amsellem@systar.com> wrote:
>
>> In what method do you make the check in the custom  itemRenderer ?
>>
>> -----Message d'origine-----
>> De : mark goldin [mailto:markzolotoy@gmail.com]
>> Envoyé : vendredi 4 octobre 2013 17:01
>> À : users
>> Objet : DataGrid custom property and item renderers
>>
>> Can someone verify that the following scenario should work?
>>
>> Spark DataGrid is extended and has a property test:String.
>> Two custom item renderers check that property and if it's not set set it.
>> if (myDataGrid(column.grid.dataGrid).test == "")
>>     myDataGrid(column.grid.dataGrid).test = column.dataField;
>>
>> What I see is that both columns would have test property empty event
>> though going thru debugger it's clear that it goes into one renderer then
>> into another. So, why would second one still has this property not set?
>>
>> Thanks
>>
>
>

Re: DataGrid custom property and item renderers

Posted by mark goldin <ma...@gmail.com>.
I do callLater from prepare to update this property.


On Fri, Oct 4, 2013 at 10:14 AM, Maurice Amsellem <
maurice.amsellem@systar.com> wrote:

> In what method do you make the check in the custom  itemRenderer ?
>
> -----Message d'origine-----
> De : mark goldin [mailto:markzolotoy@gmail.com]
> Envoyé : vendredi 4 octobre 2013 17:01
> À : users
> Objet : DataGrid custom property and item renderers
>
> Can someone verify that the following scenario should work?
>
> Spark DataGrid is extended and has a property test:String.
> Two custom item renderers check that property and if it's not set set it.
> if (myDataGrid(column.grid.dataGrid).test == "")
>     myDataGrid(column.grid.dataGrid).test = column.dataField;
>
> What I see is that both columns would have test property empty event
> though going thru debugger it's clear that it goes into one renderer then
> into another. So, why would second one still has this property not set?
>
> Thanks
>

RE: DataGrid custom property and item renderers

Posted by Maurice Amsellem <ma...@systar.com>.
In what method do you make the check in the custom  itemRenderer ? 

-----Message d'origine-----
De : mark goldin [mailto:markzolotoy@gmail.com] 
Envoyé : vendredi 4 octobre 2013 17:01
À : users
Objet : DataGrid custom property and item renderers

Can someone verify that the following scenario should work?

Spark DataGrid is extended and has a property test:String.
Two custom item renderers check that property and if it's not set set it.
if (myDataGrid(column.grid.dataGrid).test == "")
    myDataGrid(column.grid.dataGrid).test = column.dataField;

What I see is that both columns would have test property empty event though going thru debugger it's clear that it goes into one renderer then into another. So, why would second one still has this property not set?

Thanks