Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed null values for get-selected in datagrid #740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions dist/husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -34606,7 +34606,10 @@ define('husky_components/datagrid/decorators/infinite-scroll-pagination',[],func
items = [];

this.sandbox.util.foreach(ids, function(id) {
items.push(this.getRecordById(id));
var item = this.getRecordById(id);
if (!!item) {
items.push(item);
}
}.bind(this));

callback(ids, items);
Expand Down Expand Up @@ -34712,7 +34715,7 @@ define('husky_components/datagrid/decorators/infinite-scroll-pagination',[],func
if (!this.gridViews[this.viewId].addRecord) {
return;
}

if (!!recordData[this.options.idKey]) {
this.pushRecords([recordData]);
}
Expand All @@ -34730,7 +34733,7 @@ define('husky_components/datagrid/decorators/infinite-scroll-pagination',[],func
if (!this.gridViews[this.viewId].addRecord) {
return;
}

this.sandbox.util.foreach(records, function(record) {
if (!!record[this.options.idKey]) {
this.pushRecords([record]);
Expand All @@ -34750,7 +34753,7 @@ define('husky_components/datagrid/decorators/infinite-scroll-pagination',[],func
if (!this.gridViews[this.viewId].removeRecord || !recordId) {
return;
}

this.gridViews[this.viewId].removeRecord(recordId);
this.removeRecordFromSelected(recordId);
this.sandbox.emit(NUMBER_SELECTIONS.call(this), this.getSelectedItemIds().length);
Expand All @@ -34763,7 +34766,7 @@ define('husky_components/datagrid/decorators/infinite-scroll-pagination',[],func
if (!this.gridViews[this.viewId].removeRecord || !recordIds) {
return;
}

this.sandbox.util.foreach(recordIds, function(recordId) {
this.gridViews[this.viewId].removeRecord(recordId);
this.removeRecordFromSelected(recordId);
Expand Down
2 changes: 1 addition & 1 deletion dist/husky.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/husky.min.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions husky_components/datagrid/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,10 @@
items = [];

this.sandbox.util.foreach(ids, function(id) {
items.push(this.getRecordById(id));
var item = this.getRecordById(id);
if (!!item) {
items.push(item);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we remove the item here somehow, if it doesn't exist? Because currently the categories are not removed in the smart content overlay, when they are deleted. And there is also no possibility to do so afterwards.

}.bind(this));

callback(ids, items);
Expand Down Expand Up @@ -1671,7 +1674,7 @@
if (!this.gridViews[this.viewId].addRecord) {
return;
}

if (!!recordData[this.options.idKey]) {
this.pushRecords([recordData]);
}
Expand All @@ -1689,7 +1692,7 @@
if (!this.gridViews[this.viewId].addRecord) {
return;
}

this.sandbox.util.foreach(records, function(record) {
if (!!record[this.options.idKey]) {
this.pushRecords([record]);
Expand All @@ -1709,7 +1712,7 @@
if (!this.gridViews[this.viewId].removeRecord || !recordId) {
return;
}

this.gridViews[this.viewId].removeRecord(recordId);
this.removeRecordFromSelected(recordId);
this.sandbox.emit(NUMBER_SELECTIONS.call(this), this.getSelectedItemIds().length);
Expand All @@ -1722,7 +1725,7 @@
if (!this.gridViews[this.viewId].removeRecord || !recordIds) {
return;
}

this.sandbox.util.foreach(recordIds, function(recordId) {
this.gridViews[this.viewId].removeRecord(recordId);
this.removeRecordFromSelected(recordId);
Expand Down