Hello,
I'm new to both KendoUI and JQuery.
I'm trying to create a new application and it's starting well.
I'm creating a "Settings" page where a user would be able to choose skin, "Native" or "Flat".
Those chooses are in a <form> and <select>,
The part of view
<li>
<label>Skin
<select class="skinchange">
<option value="">Native</option>
<option value="flat">Flat</option>
</select>
</label>
</li>
I would like to call a function in "app.js" when an option is chosen.
app.changeSkin = function (e) {
if (e.sender.element.value() === "flat") {
mobileSkin = "flat";
}
else {
mobileSkin = "";
}
app.application.skin(mobileSkin);
};
I don't know how to do it or if it's possible :)
By having following code in the index.html I can change the skin but I would prefer If I could concentrate all that stuff in .js files.
<script>
$( ".skinchange" ).change(function() {
var mobileSkin = $(".skinchange").val();
app.application.skin(mobileSkin);
});
</script>
Best regards and thanks in advance!
I'm new to both KendoUI and JQuery.
I'm trying to create a new application and it's starting well.
I'm creating a "Settings" page where a user would be able to choose skin, "Native" or "Flat".
Those chooses are in a <form> and <select>,
The part of view
<li>
<label>Skin
<select class="skinchange">
<option value="">Native</option>
<option value="flat">Flat</option>
</select>
</label>
</li>
I would like to call a function in "app.js" when an option is chosen.
app.changeSkin = function (e) {
if (e.sender.element.value() === "flat") {
mobileSkin = "flat";
}
else {
mobileSkin = "";
}
app.application.skin(mobileSkin);
};
I don't know how to do it or if it's possible :)
By having following code in the index.html I can change the skin but I would prefer If I could concentrate all that stuff in .js files.
<script>
$( ".skinchange" ).change(function() {
var mobileSkin = $(".skinchange").val();
app.application.skin(mobileSkin);
});
</script>
Best regards and thanks in advance!