1

I am working on sencha touch2.0 app and I want to send data from one screen to another. I know this question has already been asked here but I don't find it helpful so I am asking it here again.

I have a checkbox listview in my app and what I want is that when I click on one or more checkboxes and go to next screen, I will get all the 'checked' list items here, means I want to send checked list items data from one screen to another. From my research on net I came to know, this can be done by dispatch() method http://docs.sencha.com/touch/2-0/#!/api/Ext.app.Application-method-dispatch. But I don't how to do it. So, please provide me any suggestion/solution to get rid of these problem.

Community
  • 1
  • 1
himanshu
  • 1,990
  • 3
  • 18
  • 36
  • have u seen this http://stackoverflow.com/questions/5173912/sencha-touch-mvc-recommended-ways-of-passing-data-through-the-controller – MAC May 14 '12 at 09:56
  • yeah i have already seen it.It describes the almost same prob. but the solution is given in sencha touch 1.0.i have done this in ST1.1 through Ext.dispatch but unable to do it in ST2.0 – himanshu May 14 '12 at 10:02
  • i have issue retrieving the selected items in the list with checkbox, am unable to figure it out. could you please help me out in resolving it? – Sathyapradeep May 21 '13 at 12:28

1 Answers1

1

Ext.dispatch() is deprecated in Sencha Touch 2.0 because of the fact that you can always call any method of any controller at anytime you want through this, right in your views:

yourAppName.getApplication().getController.method(params)

Or even further, you can make it automatic through refs and controls in your controller.

Thiem Nguyen
  • 6,345
  • 7
  • 30
  • 50
  • is param will be my data and how i will get the data to next screen? – himanshu May 15 '12 at 12:29
  • exactly, when your params (data, said you) are passed to a controller method, its easy to deal with them or simply store them, even globally, through `Stores` and `Models`, ok? – Thiem Nguyen May 15 '12 at 12:33
  • 1
    a little bit more details. In ST2, `Ext.Dispatch` is removed because it's not really nice to MVC structure. All logical processes belong to Controller, params (data) belong to Models / Stores. That's it. – Thiem Nguyen May 15 '12 at 12:35
  • but how i will get it to the next screen? – himanshu May 15 '12 at 12:36
  • what do you mean by "get it to the next screen"? Assuming that you've passed data to controller method, store them in model/store, then those data is **persistent** through all your application, accessible whenever you want. xD This is recommended way in Sencha Touch 2 and it's great, right? – Thiem Nguyen May 15 '12 at 12:40
  • 1
    It was a bit complected to me to understand as i have not so much ex. in sencha,but you did great job and make me understand thanx for you help. – himanshu May 15 '12 at 12:44