I have created 3 gridster widget with 2 buttons inside widget for remove widget and for refresh widget. Removing of widget is done as gridster have inbuilt remove_widget function but how do i refresh the content inside the widget. I have one button at the top for adding widget so in that also i want the refresh widget button.
// Javascript Code// Script File
$(function () {
$(".gridster ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [140, 140],
animate: true,
})
}).data('gridster');
$(document).on("click", ".gridster .delete-button", function () {
var gridster = $(".gridster ul").gridster().data('gridster');
gridster.remove_widget($(this).parent());
});
$(document).on("click", ".add-small", function () {
var gridster = $(".gridster ul").gridster().data('gridster');
gridster.add_widget('<li class=""><a href="#" class="delete-button" style="float:right;"><i class="fa fa-times"></i></a><a href="#" class="refresh" style="float: right;"><i class="fa fa-refresh"></i></a><h3>Title</h3><div class="content"><h3>3</h3></div></li>', 1, 1, 1, 1);
});
Thanks in advance