Skip to content

Commit 12d2aae

Browse files
committed
Batch up into one refresh
1 parent 762913c commit 12d2aae

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Griddly/Scripts/griddly.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,8 @@
567567

568568
$(".griddly-filters-inline input, .griddly-filters-inline select", this.$element).on("change", $.proxy(function (event)
569569
{
570-
this.refresh(true);
570+
if (this.options.autoRefreshOnFilter)
571+
this.refresh(true);
571572
}, this));
572573

573574
$(".griddly-filters-inline .filter-content input", this.$element).keyup(function (event)
@@ -701,6 +702,8 @@
701702

702703
setFilterValues: function(filters, isPatch)
703704
{
705+
this.options.autoRefreshOnFilter = false;
706+
704707
if (isPatch !== true)
705708
{
706709
var allFilters = $(".griddly-filters input, .griddly-filters select", this.$element).add(this.$inlineFilters);
@@ -715,6 +718,9 @@
715718
for (var key in filters)
716719
$("[name='" + key + "']").val(filters[key]).change();
717720
}
721+
722+
this.options.autoRefreshOnFilter = true;
723+
this.refresh(true);
718724
},
719725

720726
buildRequest: function(paging)
@@ -923,7 +929,8 @@
923929
isMultiSort: true,
924930
lastSelectedRow: null,
925931
rowClickModal: null,
926-
selectedRows: null
932+
selectedRows: null,
933+
autoRefreshOnFilter: true
927934
};
928935

929936
function GriddlyButton()

0 commit comments

Comments
 (0)