Skip to content

Commit

Permalink
SUPINT-1868: update data grid and table to support select all.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsd committed Feb 24, 2021
1 parent 7ea0206 commit 78dca14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ui/nuxeo-data-grid/nuxeo-data-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ import { PageProviderDisplayBehavior } from '../nuxeo-page-provider-display-beha
<div id="container">
<slot name="nuxeo-selection-toolbar"></slot>
<!--div>
<paper-checkbox checked="[[_isSelectAllChecked]]" on-change="_toggleSelectAll">Select all</paper-checkbox>
</div-->
<div class="header">
<div id="filters" class="filters">
<dom-repeat items="[[filters]]" as="filter">
Expand Down
6 changes: 5 additions & 1 deletion ui/nuxeo-data-table/iron-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ import '../nuxeo-button-styles.js';
<div id="header">
<nuxeo-data-table-row header>
<nuxeo-data-table-checkbox header hidden$="[[!selectionEnabled]]"></nuxeo-data-table-checkbox>
<nuxeo-data-table-checkbox
checked="[[_isSelectAllChecked]]"
on-click="_toggleSelectAll"
hidden$="[[!selectionEnabled]]"></nuxeo-data-table-checkbox>
<dom-repeat items="[[columns]]" as="column">
<template>
<nuxeo-data-table-cell
Expand Down Expand Up @@ -512,6 +515,7 @@ import '../nuxeo-button-styles.js';
constructor() {
super();
this.handlesSorting = true;
this.handlesSelectAll = true;
this._observer = dom(this).observeNodes((info) => {
const hasColumns = function(node) {
return node.nodeType === Node.ELEMENT_NODE && node instanceof Nuxeo.DataTableColumn;
Expand Down
5 changes: 5 additions & 0 deletions ui/nuxeo-page-provider-display-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ export const PageProviderDisplayBehavior = [
value: false,
},

handlesSelectAll: {
type: Boolean,
value: false,
},

_lastSelectedIndex: Number,
},

Expand Down

0 comments on commit 78dca14

Please sign in to comment.