Skip to content

Commit

Permalink
Merge pull request #14988 from resilient-tech/get-checked-items
Browse files Browse the repository at this point in the history
feat: add `get_checked_items` for query report
  • Loading branch information
mergify[bot] committed Nov 22, 2021
2 parents 48be725 + 3f2eee3 commit fee4a49
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,19 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
this.$chart.toggle(flag);
this.$summary.toggle(flag);
}

get_checked_items(only_docnames) {
const indexes = this.datatable.rowmanager.getCheckedRows();

return indexes.reduce((items, i) => {
if (i === undefined) return items;

const item = this.data[i];
items.push(only_docnames ? item.name : item);
return items;
}, []);
}

// backward compatibility
get get_values() {
return this.get_filter_values;
Expand Down

0 comments on commit fee4a49

Please sign in to comment.