I got a small problem, I started using gridster today :)
My requirements are as following:
Two widgets per row
When a user clicks "Add widget" a widget should be created as the last widget in the grid
When a user clicks close button (resides in the li.header) the selected widget should be removed and all other widgets should reposition themselves to grab empty space on the left or up a row.
Reality:
When a user clicks "Add widget" a widget is created at the end
When a user clicks close button the widget is removed but only a single widget is repositioned (the one that resides in the row under). So, say we have 3 widgets on the left side of the grid and 3 on the right side (remember, two widget per row). If I remove the 3rd widget on the left side then result is 2 on left side and 3 on the right insted of the 3rd from the right side moving to the left side on the same row.
This is the code I use to remove the widget:
gridster.$el
.on('click', 'li header a', function ()
{
var currentWdg = $(this).closest('li');
gridster.remove_widget(currentWdg, false);
})
Hi
I got a small problem, I started using gridster today :) My requirements are as following:
Reality:
This is the code I use to remove the widget: gridster.$el .on('click', 'li header a', function () { var currentWdg = $(this).closest('li'); gridster.remove_widget(currentWdg, false); })
Any ideas?
Kind regards Toto