gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

'change' event fires when nothing changes, items is empty

Open piwi91 opened this issue 11 years ago • 2 comments

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
        });
    }
})

piwi91 avatar Jun 08 '15 09:06 piwi91

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.

jffaust avatar Jun 10 '15 21:06 jffaust

It's fixed now. Please check it out.

troolee avatar Jun 19 '15 02:06 troolee