Matthew Pickard
Posts: 0
Joined: Wed Jun 25, 2014 4:09 pm

Login navigation to separate pages.

Is there a simple way to have a user navigated to a certain page based of certain criteria? (ie: a basic user ends up on the "User Page" and a manager will end up on the "Manager Page".)

So far, I have the login information stored locally, so I am hoping to just use a simple script like:

localStorage.get(""account type"")
navigate.to(userPage) or navigate.to(managerPage):

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Login navigation to separate pages.

Hi Matthew.

Yes, you can use JS code:

pre

Apperyio.navigateTo("pageYouNeed");

/pre

Also please take a look here for details: http://devcenter.appery.io/documentat...

Regards.

Matthew Pickard
Posts: 0
Joined: Wed Jun 25, 2014 4:09 pm

Login navigation to separate pages.

Awesome, I was hoping there was an "Apperyio" I could use.

I was looking into something along the lines of:

$("#nav").keydown(function (e) {

Code: Select all

 if (e.keyCode !== 13) { // 13 = Enter 
     return; 
 } 
 switch ($(this).val()) { 
 case "admin": 
     location.href = "admin.html"; 
     break; 
 case "terms": 
     location.href = "terms.html"; 
     break; // etc 
 } 

});

Matthew Pickard
Posts: 0
Joined: Wed Jun 25, 2014 4:09 pm

Login navigation to separate pages.

This is the final code and it works like a charm!!

if(localStorage.getItem('currentPerm') == "mngr"){Apperyio.navigateTo("ManagerPage");}
else{
if(localStorage.getItem('currentPerm') == "admin"){Apperyio.navigateTo("AdminPage");}
else{
{Apperyio.navigateTo("UserPage");}
}
}

Thank you so much for you help!! This was WAY easier than what I was researching!

Return to “Issues”