Reputation: 197
I'm trying to add a KendoUI grid to my SPA, I'm using the Hot Towel template. It just show as a line and I'm not sure what I'm doing wrong.
I've followed the example here: http://kendo-labs.github.io/knockout-kendo/web/Grid.html
<div data-bind="kendoGrid: items" />
Here is a jsFiddle demonstrating the problem. http://jsfiddle.net/Togas/NfK6W
EDIT: removed the durandal tag since that doesn't appear to be part of the problem
Upvotes: 1
Views: 1165
Reputation: 36
When you call ko.applyBindings, viewModel.items is empty, so it uses that to draw the grid...meaning it has no columns and no rows. So you get a line if you haven't defined anything in your binding options. Then when your ajax call completes it fails to redraw.
Define your grid with columns and wrap breeze entities in a rowViewModel with defined columns.
<div data-bind="kendoGrid: { data: items, groupable: true, sortable: true, columns: [ {field: 'Description',width: 90,title: 'Description'}] }"></div>
Upvotes: 2
Reputation: 3723
Edit: Updated wrong link. HotTowel is based on DurandalJS. Did you see http://durandaljs.com/documentation/KendoUI/ and follow the instruction?
Upvotes: 1