[TYPO3-mvc] JSON - based View

Frank Gerards F.Gerards at esolut.de
Thu May 10 15:55:17 CEST 2012


Hi,

thx, saadly your config doesnt do the trick :S ... it only renders ObjektA with all properties but the "bereich" property. I debugged into your class and the right object structures is passed to the functions, but the configuration is "lost" after the"location" branch is rendered - any clue why this could happen ?

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Dennis Ahrens
Gesendet: Donnerstag, 10. Mai 2012 15:29
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] JSON - based View

Hi Frank,

On 10.05.2012 15:10, Frank Gerards wrote:
> ...->setConfiguration(
>                Array(
>                   'data' =>  array(
>                      'locations' =>  array(
>                           '_descendAll' =>  array()
>                      )
>                   )
>               )
>        )
>
> What is rendered are all ObjektA array-entries , but NOT the ObjektB entries.
>
> What would be the right syntax for the configuration to render the complete structure down to ObjektB with the ext_js_json_view ?

Objects are not included by default (DateTime, too), you need to tell this for each subobject in addition.

...->setConfiguration(
                 Array(
                    'data' =>  array(
                       'locations' =>  array(
                            '_descendAll' =>  array(
			      'bereich' => array(
				 '_descendAll' => array()
			      )
			   )
                       )
                    )
                )
         )

If there are objects inside 'bereich' you need to specify them, too.

I usually write a static method e.g. in a corresponding controller, that defines what has to be rendered for a specfic object. Those methods call each other in the case of aggregates.

This way you have a configuration for each object and can combine them depending on your purpose.

regards
Dennis
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list