Skip to content

Commit 9459375

Browse files
committed
Add refresh skipping to toggleFilterMode
Remove duplicate refreshing on setFilterMode
1 parent 8e2a007 commit 9459375

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Griddly/Scripts/griddly.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@
714714
this.$element.find("tr.griddly-filters:not(tr.griddly-filters-" + this.options.filterMode.toLowerCase() + ")").hide();
715715
this.$element.find("tr.griddly-filters-" + this.options.filterMode.toLowerCase()).show();
716716

717-
this.setFilterValues(currentFilters, true);
717+
this.setFilterValues(currentFilters, true, true);
718718

719719
var request2 = this.buildRequest();
720720

@@ -725,11 +725,11 @@
725725
}
726726
},
727727

728-
toggleFilterMode: function()
728+
toggleFilterMode: function(noRefresh)
729729
{
730730
if (this.options.allowedFilterModes.length > 1)
731731
{
732-
this.setFilterMode(this.options.filterMode == "Inline" ? "Form" : "Inline");
732+
this.setFilterMode(this.options.filterMode == "Inline" ? "Form" : "Inline", noRefresh);
733733
}
734734
},
735735

@@ -785,7 +785,7 @@
785785
$(input[0]).change();
786786
},
787787

788-
setFilterValues: function(filters, isPatch)
788+
setFilterValues: function(filters, isPatch, noRefresh)
789789
{
790790
this.options.autoRefreshOnFilter = false;
791791

@@ -804,7 +804,11 @@
804804
this.$element.trigger("setfilters.griddly", filters);
805805

806806
this.options.autoRefreshOnFilter = true;
807-
this.refresh(true);
807+
808+
if (!noRefresh)
809+
{
810+
this.refresh(true);
811+
}
808812
},
809813

810814
resetFilterValues: function ()

0 commit comments

Comments
 (0)