angularjsgridster

Angular gridster moving issue


I'm trying to create an example using angular gridster but I'm not able to reach my goal. All I want to do is that if I move item A between item B and item C, item C will be pushed to the right, item B will be pushed to the left, and item A will take the place of item B.

What happens is that I can only move an item to an empty place. Here are the options that I'm using:

$scope.gridsterOptions = {
    columns: 12,
    maxRows: 1,
    pushing: false,
    floating: false,
    resizable: {
        enabled: false,
    },
    draggable: {
        enabled: true, // whether dragging items is supported
    }
};

Can anybody fix that? Here is the sample code on plunker.


Solution

  • After pushing: false, add this new line:

    swapping: true,
    

    This should fix it.