Thread: ExtJS and ZF
View Single Post
  #3 (permalink)  
Old 06-13-2008, 12:16 PM
breich breich is offline
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default Context Switching

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!
Reply With Quote