Sencha Touch MVC — recommended ways of passing data through the controller?

前端 未结 4 1847
情深已故
情深已故 2021-01-02 07:32

I\'m using Sencha Touch for a mobile app and am using the MVC functionality in it. I like Sencha quite a bit but I\'m having a little trouble when it comes to passing data

4条回答
  •  青春惊慌失措
    2021-01-02 08:14

    I think you're on the right track with Ext.Dispatch. The parameters you add in the Dispatch options object are passed to the action method on the controller.

    E.g.

    showMap: function(options){ 
                   var id = options.id; 
                   //load data based on the id and pass it to your map
                   ...
             }
    

    I also think you should set the historyUrl on the Dispatch options object so that if they refresh the page the id will still get sent to the controller action.

提交回复
热议问题