Hi, how do I set the function for a View's data-after-show if I use a model?
I have a model as below:
A view with data-model set to foodMS and data-after-show="showMessage". However the showMessage does not fire when the view come into place.
The span id="showMessage" can fire the function if clicked.
Is this the correct way to set the function for the data-after-show?
Thanks.
I have a model as below:
var
foodMS = kendo.observable({
description:
"Description"
,
isDescriptionShown:
false
,
showDescription:
function
(e) {
// show the span by setting isDescriptionShown to true
this
.set(
"isDescriptionShown"
,
true
);
},
showMessage:
function
(e) {
alert(
this
.get(
"isDescriptionShown"
));
}
});
A view with data-model set to foodMS and data-after-show="showMessage". However the showMessage does not fire when the view come into place.
The span id="showMessage" can fire the function if clicked.
<
div
data-role
=
"view"
data-title
=
"Add Nice Food"
data-layout
=
"main"
id
=
"foodMS_add"
data-model
=
"foodMS"
data-after-show
=
"showMessage"
>
<
span
id
=
"showsomething"
data-bind
=
"events: { click: showMessage }"
>
<
button
data-role
=
"button"
>Show</
button
>
</
span
>
</
div
>
Is this the correct way to set the function for the data-after-show?
Thanks.