or
01.
<!DOCTYPE html>
02.
<
html
>
03.
<
head
>
04.
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=UTF-8"
>
05.
<
style
>
06.
#container {
07.
width: 10000px;
08.
height: 10000px;
09.
position: relative;
10.
}
11.
12.
#myBox {
13.
position: absolute;
14.
top: 600px;
15.
left: 1000px;
16.
height: 100px;
17.
width: 100px;
18.
padding: 10px;
19.
background: red;
20.
}
21.
</
style
>
22.
</
head
>
23.
<
body
>
24.
<
div
data-role
=
"view"
id
=
"myViewport"
data-zoom
=
"true"
data-init
=
"initHome"
>
25.
<
div
id
=
"container"
>
26.
<
div
id
=
"myBox"
>Foo</
div
>
27.
</
div
>
28.
</
div
>
29.
30.
<
script
>
31.
function initHome(e)
32.
{
33.
var scroller = e.view.scroller;
34.
var bTop = $("#myBox").position().top;
35.
var bLeft = $("#myBox").position().left;
36.
scroller.animatedScrollTo(-(bLeft), -(bTop));
37.
}
38.
39.
new kendo.mobile.Application();
40.
</
script
>
41.
</
body
>
42.
</
html
>
var
editableModel =
function
()
{
this
.isEditing =
false
;
};
editableModel.prototype.toggleEditMode =
function
(e)
{
this
.set(
"isEditing"
, !
this
.isEditing);
e.stopPropagation();
};
var
individualClient =
function
()
{
this
.clientCode =
""
;
this
.initials =
""
;
this
.title =
""
;
this
.dateOfBirth =
""
;
this
.language =
""
;
};
individualClient.prototype =
new
editableModel();
var
viewModel =
new
individualClient();
viewModel.clientCode =
"ABS"
;
viewModel.initials =
"JA"
;
...
//set the rest of the properties
kendo.bind($(
".binding-container"
),viewModel);
<
a
href
=
"#"
onclick
=
"viewModel.toggleEditMode()"
>Edit</
a
>
<!--NOTE: This hyperlink is not located inside the binding-container which is why I'm calling it as I am, using the onclick event and the qualified object name -->
<
span
data-bind
=
"text: clientCode, invisible: isEditing"
>@Model.ClientCode</
span
>