2

i have a list control. I want to pass the selected list item from that view to another view and set the value in text field in sencha touch can anybody tell how to do?

Benoit Cuvelier
  • 806
  • 7
  • 23
user386430
  • 4,837
  • 13
  • 41
  • 45

2 Answers2

1

Lets's say you have a ViewA with your list inside, and you have ViewB with all details of the item yout tapped.

If you want to send the data of your item, use Controllers of each view. Inside ControllerA, listen at "tap" event of your list component, and call a special function defined in ControllerB : let's say updateTextField () wich update your textfield value.

You can see this scheme : Links beetween 2 controllers of 2 views

Benoit Cuvelier
  • 806
  • 7
  • 23
  • you are calling unnecessary function ControllerB.updateTextField here in tap event. You can update text field direct inside in tap event. – Mohit Saxena Sep 16 '15 at 17:33
0

If you have to set some selected value of a list on a text field then on itemtap event of list, get reference of that field and set value.

Mohit Saxena
  • 1,439
  • 1
  • 12
  • 21