Skip to content

Instantly share code, notes, and snippets.

@ncole458
Last active January 23, 2016 06:02
Show Gist options
  • Save ncole458/2698ecdc10f79cbef68c to your computer and use it in GitHub Desktop.
Save ncole458/2698ecdc10f79cbef68c to your computer and use it in GitHub Desktop.
Kendo UI data-title change (using onclick over data-click)
<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>
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