Hi Kendo gurus,
I am wondering if I am doing something wrong.
Basically I have a couple of functions that check localStorage session variables and I want to bind the events to list elements within my Kendo mobile application.
I have a list view like so: KENDO LIST HTML
<li data-icon="globe"><a href="#page1">Page 1</a></li>
<li data-icon="reply"><a href="#page2">Page 2</a></li>
<li data-icon="settings"><a href="#page3">Page3</a></li>
Then a function that checks if the user is a guest, and re-directs them: JS:
function checkSession() {
if (localStorage.getItem("guest") == "true") {app.navigate('#pleaseregister');}else {app.navigate('#page1');}
};
I've tried:
#1. <li data-icon="globe"><a href="#" onClick="checkSession();">Page 1</a></li>
and:
#2. <li data-icon="globe"><a href="#" data-click="checkSession">Page 1</a></li>
#3. <li data-click="checkSession" data-icon="globe"><a href="#" >Page 1</a></li>
In example 1, onClick events fire in the web browser/emulator but not on physical device, it appears very unresponsive.
Example 2+ 3 does not work at all.
When I use a button like so:
<a data-icon="toprated" data-click="checkSession" data-role="button" style="width:90%; height:30px;">Create Listing</a>
It works! But I like the look of the list view.
If you could let me know if there is a special way of doing this, it would be very much appreciated, I've noticed several Kendo UI users on here asking this question and there doesn't seem to have been an answer given? It's driving me crazy.
Regards,
Damien.
I am wondering if I am doing something wrong.
Basically I have a couple of functions that check localStorage session variables and I want to bind the events to list elements within my Kendo mobile application.
I have a list view like so: KENDO LIST HTML
<li data-icon="globe"><a href="#page1">Page 1</a></li>
<li data-icon="reply"><a href="#page2">Page 2</a></li>
<li data-icon="settings"><a href="#page3">Page3</a></li>
Then a function that checks if the user is a guest, and re-directs them: JS:
function checkSession() {
if (localStorage.getItem("guest") == "true") {app.navigate('#pleaseregister');}else {app.navigate('#page1');}
};
I've tried:
#1. <li data-icon="globe"><a href="#" onClick="checkSession();">Page 1</a></li>
and:
#2. <li data-icon="globe"><a href="#" data-click="checkSession">Page 1</a></li>
#3. <li data-click="checkSession" data-icon="globe"><a href="#" >Page 1</a></li>
In example 1, onClick events fire in the web browser/emulator but not on physical device, it appears very unresponsive.
Example 2+ 3 does not work at all.
When I use a button like so:
<a data-icon="toprated" data-click="checkSession" data-role="button" style="width:90%; height:30px;">Create Listing</a>
If you could let me know if there is a special way of doing this, it would be very much appreciated, I've noticed several Kendo UI users on here asking this question and there doesn't seem to have been an answer given? It's driving me crazy.
Regards,
Damien.