gzamboni wrote
> Hi,
> i start training and learning zf2 with the tuttorial on the web site,
> now i want to integrate a jqGrid and i need to retrieve a json string from
> the view model
> 
> my code example:
*
>  public function indexAction()
>     {                                                                
> ------------
>   return new ViewModel(array(                                             
> |
>            'albums' => $this->getAlbumTable()->fetchAll(),            |---
> view model data
>         ));  
*
>                                                                          |
>                                                                      
> -------------
> i found on akrabat site the json model strategy and i add this JsonModel:
> 
> 
>       
*
>   $result = new JsonModel(array(
>       
>        'albums' => $this->getAlbumTable()->fetchAll(),
>        'success'=>true,
>        
> 
>         )); 
>         echo $result;
*
> 
> but it returns a json string empty xD
> im really noob in knowledge of zf but i'll try to do my best :D
> 
> Wait for response , 
> regards.

Did you try to register JSON rendering strategy first as per docs in
Zend\View quickstart component?




-----
Cheers,
--
Luke Mierzwa
--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-JqGrid-integration-tp4656925p4656939.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to