PDA

View Full Version : How to lad view/Container from top, on Backbutton click?



anilvardhan.p
12 Feb 2014, 9:11 PM
I have a view with form elements lengthier then the window, after scroll down pressing next button.... it's redirecting to 2nd view. Inside the 2nd view if i click on back button, the 1st view showing from the place of button only.

I need it should load/show from top. please suggest e how i can do it.

Note: For navigation i have separate navigation view.

Advanced Thanks!!

Gary Schlosberg
13 Feb 2014, 5:23 PM
Are you talking about the brower's back button? I believe Ext.util.History will let you listen to the back button.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.util.History

Perhaps you can use scroll to get back to the top:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.dom.Element-method-scroll

anilvardhan.p
20 Feb 2014, 6:31 PM
i found the sollutio.
it's not for browser back button.... it's for app back button.
based on view container id setted the position.




var currentViewft = this.getFundsTransferNavView().getActiveItem().xtype;
//anil added for title change on back
//alert(currentViewft);

// fundtransfer
if(currentViewft == 'fund-transfer-interbank-form')
{
// anil added for scroll fix deffect25
Ext.getCmp('fundtransferinterbankform').getScrollable().getScroller().scrollTo('top', 0);
}