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

feat: add get_checked_items for query report #14988

Merged
merged 2 commits into from Nov 22, 2021

Conversation

pruthvi145
Copy link
Contributor

@pruthvi145 pruthvi145 commented Nov 16, 2021

When data of an QueryReport is selectable (checkBoxColumn:true in datatable options), we don't have direct way to get selected items like ListView or ReportView.

This PR introduces a method QueryReport.get_checked_items (inspired by ReportView.get_checked_items).

Usage

frappe.query_reports["Your Report"] = {
  get_datatable_options(options) {
    return Object.assign(options, {
      // Add checkbox Column to the datatable
      checkboxColumn: true,
    });
  },
  onload(report) {
    report.page.add_action_item(__("Test"), () => {
      const checked_rows = report.get_checked_items();
      ...
    });
  },
};

no-docs

@pruthvi145 pruthvi145 requested a review from a team as a code owner November 16, 2021 09:53
@pruthvi145 pruthvi145 requested review from leela and removed request for a team November 16, 2021 09:53
@pruthvi145 pruthvi145 changed the title feat: add for query report feat: add get_checked_items for query report Nov 16, 2021
@codecov
Copy link

codecov bot commented Nov 16, 2021

Codecov Report

Merging #14988 (3f2eee3) into develop (48be725) will decrease coverage by 0.13%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop   #14988      +/-   ##
===========================================
- Coverage    53.70%   53.57%   -0.14%     
===========================================
  Files          743      743              
  Lines        64800    64799       -1     
  Branches      5401     5403       +2     
===========================================
- Hits         34803    34718      -85     
- Misses       26710    26776      +66     
- Partials      3287     3305      +18     
Flag Coverage Δ
ui-tests 46.62% <0.00%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@sagarvora
Copy link
Collaborator

UI test 2 wasn't stopping, so I cancelled it.

@mergify mergify bot merged commit fee4a49 into frappe:develop Nov 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants