Cooper
Cooper

Reputation: 197

Using Kendo Grid with Breeze and Knockout

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

Answers (2)

ruan.isheeple
ruan.isheeple

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>

http://jsfiddle.net/dcgVA/2/

Upvotes: 2

RainerAtSpirit
RainerAtSpirit

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

Related Questions