This question is locked. New answers and comments are not allowed.
I am using your KendoUI sample app as a starting point. On the Login view, once logged in, I have added a button to go to a mileage page. So after login, there would be a logout button and a mileage button.
I have created an html page in a folder named views.
views/mileage.html
I also created a .js file named mileage.js
so the relevant code block in index.html looks like this...
the onMileageClick in login.js looks like this
Once logged in, when I tap the mileage button, it redirects me to views/mileage.html
I have my mileage.js setup pretty much like the login.js
So what happens is, when i tried to navigate back to the screen that contained the logout and mileage buttons(the view displayed after succesful login) from mileage.html, it was taking me back to the login screen BEFORE login making me login again. I just want the mileage.html to redirect back to the previous screen.
Also, I am not sure if I have my javascript setup right to interact with the kendoui model.
I have created an html page in a folder named views.
views/mileage.html
I also created a .js file named mileage.js
so the relevant code block in index.html looks like this...
<
button
class
=
"metrobutton cw40"
id
=
"btnGotoMileage"
data-bind
=
"click: onMileageClick, visible: isLoggedIn"
>Mileage</
button
>
<
button
class
=
"metrobutton cw40"
id
=
"logout"
data-bind
=
"click: onLogout, visible: isLoggedIn"
>Logout</
button
>
the onMileageClick in login.js looks like this
onMileageClick:
function
(){
window.location =
"views/mileage.html"
;
},
Once logged in, when I tap the mileage button, it redirects me to views/mileage.html
I have my mileage.js setup pretty much like the login.js
(
function
(global)
{
var
MileageViewModel,
app = global.app = global.app || {};
MileageViewModel = kendo.data.ObservableObject.extend({
startingmileage:
""
,
endingmileage:
""
,
onSubmitMileage:
function
()
{
var
that =
this
,
startingmileage = that.get(
"startingmileage"
).trim(),
endingmileage = that.get(
"endingmileage"
).trim();
if
(startingmileage ===
""
|| endingmileage ===
""
)
{
navigator.notification.alert(
"Both fields are required!"
,
function
()
{
},
"Mileage submission failed"
,
'OK'
);
return
;
}
//that.set("isLoggedIn", true);
},
onGotoMainMenu:
function
()
{
//NEED HELP HERE
},
clearForm:
function
()
{
var
that =
this
;
that.set(
"startingmileage"
,
""
);
that.set(
"endingmileage"
,
""
);
}
});
app.mileageService =
{
viewModel:
new
MileageViewModel()
};
})(window);
So what happens is, when i tried to navigate back to the screen that contained the logout and mileage buttons(the view displayed after succesful login) from mileage.html, it was taking me back to the login screen BEFORE login making me login again. I just want the mileage.html to redirect back to the previous screen.
Also, I am not sure if I have my javascript setup right to interact with the kendoui model.