Hi Piotr,

I have tried overriding the set data method. The problem is that
"dataField" is undefined.

public override function set data(value:Object):void
{
super.data = value;
stringValue = value[dataField];
this.text = stringValue;
}

stringValue is cast to "".

Any thoughts?

On Tue, 23 Mar 2021 at 09:03, Piotr Zarzycki <piotrzarzyck...@gmail.com>
wrote:

> If that's the case I would remove everything in that item renderer,
> override property data and there filter:
>
> super.data = value;
> if (!data) {
>     this.text = "";
> }
>
> wt., 23 mar 2021 o 08:57 David Slotemaker de Bruine <
> dslotema...@vicensvives.com> napisał(a):
>
>> Yes! but I wanted to show that the basic version is not working!
>>
>> My backend returns string constants for null objects and null numbers, I
>> need to filter these out in the renderer.
>>
>> On Tue, 23 Mar 2021 at 08:39, Piotr Zarzycki <piotrzarzyck...@gmail.com>
>> wrote:
>>
>>> Hi David,
>>>
>>> It looks like your DataGridItemRenderer is do same thing as the default
>>> one, what's the point of creating this one ? Are you going to expand it's
>>> functionality ?
>>>
>>> Thanks,
>>> Piotr
>>>
>>> wt., 23 mar 2021 o 08:31 David Slotemaker de Bruine <
>>> dslotema...@vicensvives.com> napisał(a):
>>>
>>>> Hi All,
>>>>
>>>> I would like to create a generic Datagrid renderer for some of my VOs.
>>>> I have followed the example for TDJ but it's not going me any output or
>>>> error message. My code is the following:
>>>> <?xml version="1.0" encoding="utf-8"?>
>>>> <j:DataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009";
>>>>     xmlns:j="library://ns.apache.org/royale/jewel"
>>>>     xmlns:js="library://ns.apache.org/royale/basic"
>>>>     >
>>>>     <fx:Script>
>>>>         <![CDATA[
>>>>             [Bindable("dataChange")]
>>>>             public function get stringValue():String
>>>>             {
>>>>                 return data[dataField] as String;
>>>>             }
>>>>
>>>> ]]>
>>>>     </fx:Script>
>>>>     <j:beads>
>>>>         <j:HorizontalCenteredLayout/>
>>>>         <js:ItemRendererDataBinding />
>>>>     </j:beads>
>>>>     <j:Label text="{stringValue}"/>
>>>> </j:DataGridItemRenderer>
>>>>
>>>> Is it because I am using "data[dataField]"? If so what is the best way
>>>> to do this without having t create a specific Renderer for each column.
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>
>>
>> --
>>
>> *David Slotemaker de Bruïne*
>> *Head of Educational Robotics*
>>
>>
>>
>> Av. Sarriá, 130 - 08017 Barcelona
>> <https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>
>>
>>
>> T. +34 932 523 729 ext. 135
>>
>> dslotema...@vicensvives.com
>>
>
>
> --
>
> Piotr Zarzycki
>


-- 

*David Slotemaker de Bruïne*
*Head of Educational Robotics*



Av. Sarriá, 130 - 08017 Barcelona
<https://maps.google.com/?q=Av.+Sarri%C3%A1,+130+-+08017+Barcelona&entry=gmail&source=g>


T. +34 932 523 729 ext. 135

dslotema...@vicensvives.com

Reply via email to