teenup
teenup

Reputation: 7667

Why this jsfiddle does not work for Kendo Knockout Sortable widget?

<ul class="ones" data-bind="foreach: itemsOne, kendoSortable: { data: itemsOne, connectWith: '.twos' }">
    <li class="item" data-bind="text: name"></li>
</ul>

<hr/><div data-bind="foreach: itemsOne"><span data-bind="text: name"></span>,</div><hr/>

<ul class="twos" data-bind="foreach: itemsTwo, kendoSortable: { data: itemsTwo, connectWith: '.ones' }">
    <li class="item" data-bind="text: name"></li>
</ul>

<hr/><div data-bind="foreach: itemsTwo"><span data-bind="text: name"></span>,</div>

var ViewModel = function() {
    this.itemsOne = ko.observableArray([
        { name: "one" },
        { name: "two" },
        { name: "three" }
    ]);

    this.itemsTwo = ko.observableArray([
        { name: "four" },
        { name: "five" },
        { name: "six" }
    ]);
};

ko.applyBindings(new ViewModel());

The fiddle is:

http://jsfiddle.net/pdudeja/X7y2k/

I have included all js files. Just the class named 'ones' and 'twos' is not there. This example is straight from the documentation url:

http://rniemeyer.github.io/knockout-kendo/web/Sortable.html

Upvotes: 0

Views: 252

Answers (1)

RP Niemeyer
RP Niemeyer

Reputation: 114792

The issue is that Knockout-Kendo needs to be included after the Knockout and Kendo scripts have loaded.

   http://rniemeyer.github.io/knockout-kendo/js/knockout-kendo.min.js

This one needs to be moved to the end. Here is an updated fiddle: http://jsfiddle.net/rniemeyer/zzYjX/

Upvotes: 1

Related Questions