gridstack.js
gridstack.js copied to clipboard
'change' event fires when nothing changes, items is empty
When dragging a widget a bit (without moving the position), the 'change' event is fired without the items variable set.
When dragging a widget to another position, the items variable is set.
My implementation:
this._on('.grid-stack', {
'change': function (event, items) {
$(document).ajaxProtocol("call", {
url: Routing.generate('my_route'),
data: {'items': this._convertItems(items)},
type: 'POST',
beforeSendCallback: null,
readyCallback: null
});
}
})
I get this behavior too. The change event is fired even if the widget is being dragged around (not pushing any other widgets) and finally stop dragging it at its original position.
It's fixed now. Please check it out.