Skip to content

Commit 91aac9b

Browse files
committed
On refresh, unselect rows that aren't displayed
1 parent 3354f76 commit 91aac9b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Build/CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Minor Version
1313
// Build Number
1414
// Revision
15-
[assembly: AssemblyVersion("3.8.5")]
16-
[assembly: AssemblyFileVersion("3.8.5")]
15+
[assembly: AssemblyVersion("3.8.6")]
16+
[assembly: AssemblyFileVersion("3.8.6")]
1717
// Uncomment the informational version to create a pre-release package
1818
//[assembly: AssemblyInformationalVersion("3.8.4-rc2")]

Griddly/Scripts/griddly.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,14 +1819,26 @@
18191819
else
18201820
this.$element.find(".griddly-pager").show();
18211821

1822-
//iterate through table and check rows that are in the selected list and have a checkbox
1822+
// iterate through table and check rows that are in the selected list and have a checkbox
18231823
var _this = this;
1824+
var remainingRows = { };
1825+
18241826
$("tbody tr", this.$element).find("input[name=_rowselect]").each(function (index, e) {
18251827
var rowkey = $(e).data("rowkey");
1826-
if (_this.options.selectedRows[rowkey])
1828+
var row = _this.options.selectedRows[rowkey];
1829+
1830+
if (row)
1831+
{
18271832
$(e).prop("checked", true);
1833+
1834+
remainingRows[rowkey] = row;
1835+
}
18281836
});
18291837

1838+
// update selected rows to only those that are still present, in case an update filtered them away
1839+
_this.options.selectedRows = remainingRows;
1840+
this.setSelectedCount();
1841+
18301842
this.triggerOrQueue(this.$element, "refresh.griddly",
18311843
{
18321844
start: startRecord,

0 commit comments

Comments
 (0)