rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
548 stars 128 forks source link

droppable options drop event issue #200

Open ibrahimerbas opened 4 years ago

ibrahimerbas commented 4 years ago

when using droppable with options like following; droppable:{data:DropTo,options:{drop:function(e,ui){//this is not firing;}}}

The problem is solved when I edit the source code as follows.

ko.bindingHandlers.droppable = { init: function(element, valueAccessor, allBindingsAccessor, data, context) { ....... var optionsDropEvent = droppableOptions.drop; //set drop method droppableOptions.drop = function(event, ui) { var droppedItem = dataGet(ui.draggable[0], DRAGKEY) || dataGet(ui.draggable[0], ITEMKEY); value(droppedItem); if (optionsDropEvent ) optionsDropEvent(event, ui); };