KoGrid won't display correctly with basic example

168 views
Skip to first unread message

jonr

unread,
May 2, 2012, 10:26:52 PM5/2/12
to knock...@googlegroups.com
Hi,

Hi,

I was looking around at grids and KoGrid seems to be what I need. Unfortunately, I can't even do a simple example and don't know whats going wrong.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>New Web Project</title>
        <script type="text/javascript" src="scripts/jquery-1.7.2.js"></script>
   <script type="text/javascript" src="scripts/knockout-2.0.0.js"></script>
   <script type="text/javascript" src="scripts/koGrid.debug.js"></script>
   <script type="text/javascript" src="scripts/viewModel.js"></script>
    </head>
    <body>
       <div style="height: 500px" data-bind="koGrid: { data: items }"></div>
       </body>
</html>

viewmodel.js file:

$(document).ready(function () {
function Item(id, name, price) {
   this.id = id;
   this.name = name;
   this.price = price;
}
var viewModel = {
   items: ko.observableArray([
       new Item(1, "One", 4.50),
       new Item(2, "Two", 5.00),
       new Item(3, "Three", 7.50)
       ])
};
ko.applyBindings(viewModel);
});

Seems pretty simple. This is what I get when I run it:



If anyone can help, that would be great.

Thanks,
Jon

jonr

unread,
May 2, 2012, 11:57:57 PM5/2/12
to knock...@googlegroups.com
wow just noticed the css file was missing... oops
Reply all
Reply to author
Forward
0 new messages