View Full Version : Extjs4 MVC. Retain Prevoius View with all the Form Data on Back Button.

14 Feb 2012, 11:16 PM

I have a 1 app with 8 veiws, 8 controllers for each view with multiple stores and models.

scenario : Navigate from first view to second view. on the second view i will provide a back button which should navigate to previous screen(first view) with all form data retained.

issue here is, on click of back button i am calling the controller 1 to bring the view 1 to front and all data which was selected has got lost.

is there any way i can retain those data on the view1.?????????

i donot wat to use a single controller to handle all 8 views as this would be a burden on a single controller file.

kindly help us out here


15 Feb 2012, 5:50 AM
How are you bringing view 1 to the front? There is nothing MVC or Ext JS does to remove your data unless you removed it or are creating a new instance.

16 Feb 2012, 12:43 AM

Just did a small workaround for this.
when i go from view 1 to view 2. view 1 instance is not destroyed and is still valid.
so wen i click back in view2 i did to hide the view2 component and show view1 component.. this did serve my purpose but i have 8 views to be manipulated in this way and all 8 views have a back button.

let me know if this is a wrong approach and if there is a better freway to do it.

Thanks Simons for all your replies. Helps me a lot