Back button and multi page apps

61 views
Skip to first unread message

Jeff Rossi

unread,
Mar 28, 2013, 10:17:42 AM3/28/13
to chocolat...@googlegroups.com
I had an app I had written using phonegap & bootstrap, but was asked to make it look more 'native' so I chose Chocolate chip, very nice.

The app is multi page, and I have no intention of making it a single page app.

The back button appears to not work for navigating to another page, so I bound a click to it and used history.back()

Some of my pages have nav lists to additional views on the same page with back buttons that work as expected going to the main view on the page.

It all works as expected when testing locally in safari, but when testing with ios simulator the back button in the additional view fires the back button in the main view and I end up on the previous page.

Anybody have any ides?

chris lejeune

unread,
Mar 28, 2013, 7:46:28 PM3/28/13
to chocolat...@googlegroups.com
Hi Jeff,

"...back button in the additional view fires the back button in the main view and I end up on the previous page."

Without code I'm taking a stab here. It sounds like the additional back buttons do not have a click event attached.  For my app, I'm using the back button in the toolbar, so I don't have this problem. But in my navbars I have different buttons depending on the view. And this is how I'm attaching the events to those different buttons.

      navBarButtons : function () { 
              $$("uibutton", "navbar").each(
                  function (item) {
                      if (item.hasClass("home")) {
                          item.bind("click",
                              function () {
                                  ... do something like nav to a file or view
                              }
                          );
                      } else if (item.hasClass("list")) {
         ...

I'm collecting, then looping, through all the uibuttons in context of the navbars and, depending on the class it owns, I'm attaching an event to it. 

Post some code or the url and I'll look at it.

Chris






$$("uibutton", "navbar").each(
                  function (item) {



--
You received this message because you are subscribed to the Google Groups "ChocolateChip-UI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chocolatechip-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages