|
|||
|
I am currently building web application using ZF 1.5.1. I use ExtJS 2.0.2 as user interface. I would like to enable data-exchange between ZF and ExtJS. The schema is on attachment (zf-extjs.jpg).
I use Zend_Json::encode() to pass data to temporary data store and then ExtJS loads that temporary data. My questions are : 1. Is there an easy way to pass data to ExtJS besides one above ? 2. How do I pass data (data that has been processed in Ext JS back to Zend (DB) ?) 3. Is there any tutorial on the internet about this subject ? Thanks, Indrajit |
|
|||
|
I had trouble with ZFW and ExtJS integration, then I discovered a handy Action Helper in the Zend Framework's MVC which makes it stupid simple.
Context Switching provides a methodology for views to be rendered differently based on the value of the "format" request parameter. If you want data to render in the usual method, pass no "format" parameter and your view script will be called as usual. Call the action handler as "/controller/action/?format=json" and the variables that you have assigned to the the view will automatically be converted to JSON and sent to the browser. From there it is just a matter of determining what keys ExtJS expects in the incoming JSON object. ExtJS doesn't always do the best job of documenting them! Hope that helps! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|