Hi everybody,
I have a problem - as the tittle says - with data binding when given element is in external file.
For example this button is in file 'views/login_form.html':
and this is the model for this click action:
When this button is index.html then everything works just fine, but when I put in in external file - well, it doesn't work. It also doesn't throw any errors - just nothing happens.
How can I fix this?
I have a problem - as the tittle says - with data binding when given element is in external file.
For example this button is in file 'views/login_form.html':
<
button
id
=
"form_submit"
data-bind
=
"events: { click: submit }"
>
Sign in
</
button
>
var viewModel = kendo.observable({
submit: function(e) {
e.preventDefault();
alert(2);
});
kendo.bind($("#form_submit"), viewModel);
How can I fix this?