Localizes alerts_grid variable to fix errors with multiple alerts tables (#6285)

This commit is contained in:
Ryan Medlyn
2017-03-28 09:00:09 -06:00
committed by Neil Lathwood
parent a776ad5c8a
commit 3712ca91fe

View File

@@ -243,6 +243,7 @@ var alerts_grid = $("#alerts_'.$unique_id.'").bootgrid({
templates: {
}
}).on("loaded.rs.jquery.bootgrid", function() {
alerts_grid = $(this);
alerts_grid.find(".incident-toggle").each( function() {
$(this).parent().addClass(\'incident-toggle-td\');
}).on("click", function(e) {
@@ -293,8 +294,11 @@ var alerts_grid = $("#alerts_'.$unique_id.'").bootgrid({
success: function(msg){
toastr.success(msg);
if(msg.indexOf("ERROR:") <= -1) {
var $sortDictionary = alerts_grid.bootgrid("getSortDictionary");
alerts_grid.bootgrid("sort", $sortDictionary);
$(".alerts").each(function(index) {
var $sortDictionary = $(this).bootgrid("getSortDictionary");
$(this).reload;
$(this).bootgrid("sort", $sortDictionary);
});
}
},
error: function(){