The goal is to use a grid control in a web resource on a form in CRM. I decided on KoGrid because it could be easily bound to the knockout view model we already had in place. The trouble is using KoGrid in a CRM context causes IE 9 to stop responding entirely. There are no exceptions or errors logged in the console; the only symptom is the browser locking up.
Putting the browser in compatibility mode fixes the issue, unfortunately in IE 9 doctypes are inherited so we can't control the render mode of the web resource. Also this really just fixes the symptom and not the cause.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="../css/KoGrid.css" rel="stylesheet" />
<script src="../js/jquery_1.8.3.min.js"></script>
<script src="../js/knockout.js"></script>
<script src="../js/koGrid_2.1.1.js"></script>
<style type="text/css">
.gridStyle {
border: 1px solid rgb(212,212,212);
width: 400px;
height: 300px;
}
</style>
</head>
<body>
<script type="text/javascript">
$(function () {
setTimeout(function () {
debugger;
function mainVm() {
var self = this;
this.myData = ko.observableArray([{ name: "Moroni", age: 50 },
{ name: "Tiancum", age: 43 },
{ name: "Jacob", age: 27 },
{ name: "Nephi", age: 29 },
{ name: "Enos", age: 34 }]);
this.gridOptions = {
canSelectRows: false,
multiSelect: false,
data: self.myData
};
};
ko.applyBindings(new mainVm());
}, 3000);
});
</script>
<div class="gridStyle" data-bind="koGrid: gridOptions"></div>
</body>
</html>
http://jsfiddle.net/wycleffsean/yHrBA/2/
What could cause this behavior ONLY in CRM? It works fine by itself in every browser. What does the render mode have to do with script behavior?