Last active
January 23, 2016 06:02
-
-
Save ncole458/2698ecdc10f79cbef68c to your computer and use it in GitHub Desktop.
Kendo UI data-title change (using onclick over data-click)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-role="view" data-title="View One" id="view-one"> | |
<header data-role="header"> | |
<div data-role="navbar"> | |
<span data-role="view-title" id="one-title"></span> | |
</div> | |
</header> | |
<a data-role="button" data-mytitle="username 1" onclick="viewtwo(this)">go to view username 1</a> | |
<a data-role="button" data-mytitle="username 2" onclick="viewtwo(this)">go to view username 2</a> | |
</div> | |
<div data-role="view" data-title="" id="view-two" data-show="onShowTwo"> | |
<header data-role="header"> | |
<div data-role="navbar"> | |
<span id="two-title"></span> <!-- note no data-role --> | |
</div> | |
</header> | |
<a data-role="button" onclick="viewone(this)">go to view 1</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = new kendo.mobile.Application(); | |
function onShowTwo() { | |
$("#view-two").attr("data-title", myTitle); | |
$("#two-title").html(myTitle); | |
} | |
function viewtwo(e) { | |
myTitle = e.getAttribute("data-mytitle"); | |
app.navigate("#view-two"); | |
} | |
function viewone(e) { | |
app.navigate("#view-one"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment