- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am currently developing an app using the Intel XDK using the jQuery UI Framework and KnockoutJS MVVM framework.
All had been progressing nicely until I upgraded to the version before 1826 (problem still exists in 1826) at which point click events bound to knockoutjs (version 3.3.0) no longer work in the emulator. Clicks still work in App Preview on my android phone and if I open index.html in a browser, just not in the emulator.
I've tried choosing non-cordova option on new project creation - no difference.
At this point it would be a lot of effort to not use knockoutjs but also very difficult to develop without the emulator, any help appreciated.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you post a simple test case that illustrates the problem? I'm not familiar with KnockoutJS, but if I have a reproducer I might be able to help.
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dale, thanks for your quick response. Here's a complete index.html file to show the problem: (knockoutjs can be downloaded at: http://knockoutjs.com/)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Blank App Designer Cordova Web App Project Template</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
<style>
@-ms-viewport { width: 100vw ; min-zoom: 100% ; zoom: 100% ; } @viewport { width: 100vw ; min-zoom: 100% zoom: 100% ; }
@-ms-viewport { user-zoom: fixed ; min-zoom: 100% ; } @viewport { user-zoom: fixed ; min-zoom: 100% ; }
</style>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/index_main.less.css" class="main-less">
<script src="js/knockout-3.3.0.js" type="text/javascript"></script>
<script src="cordova.js" id="xdkJScordova_"></script>
<script src="js/app.js"></script>
<script src="js/init-app.js"></script>
<script src="xdk/init-dev.js"></script>
</head>
<body>
<div class="upage vertical-col" id="mainpage" data-role="page">
<div class="widget uib_w_1 d-margins" data-uib="media/text" data-ver="0">
<div class="widget-container left-receptacle"></div>
<div class="widget-container right-receptacle"></div>
<div>
<button data-bind="click: resetData">Click test</button>
<strong data-bind="text: testStr">Knockout bind failed</strong>
</div>
</div>
</div>
<script>
function VM_Mainpage(){
this.testStr = "Knockout bind worked";
this.resetData = function() {
alert("Click test button pressed");
};
}
ko.applyBindings(VM_Mainpage);
</script>
</body>
</html>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Swati,
Thanks for your reply - I can see from your image that the alert does indeed happen.
Knockoutjs file is included - I get the bind success message on screen. Any other idea why it might fail? I notice that I forgot to say that I'm running on linux.
I could try upgrading my windows boot XDK to 1826 (I haven't so far since it still works), but can I regress if it has the same problem?
Thanks Gavin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Swati,
I took the risk of upgrading to build 1878 on my Windows machine (took a backup that I may have been able to regress to), my code works fine in that environment.
I also upgraded my Linux machine to 1878 - that still fails with exactly the same code (in my dropbox - not copied) - so I assume that there is an issue in the Linux XDK emulator? For now I can develop in Windows but Linux is my preferred environment.
Thanks Gavin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gavin,
I don't know if this will help. I imported my Phonegap Build project that used Knockout.js 3.3.0 and Jqm 1.4.5 onto XDK 1878 running on Win 8.1 and the knockout click bindings work on the emulator.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page