Skip to content
Open
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
22 changes: 22 additions & 0 deletions paper-datatable-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,28 @@ class DtPaperDatatableApi extends Polymer.mixinBehaviors(
});
}

/**
* Uncheck the checkbox
*
* @property selectRow
* @param {String} value The value of the row following the selectableDatakey.
*/
deselectRow(value) {
const table = this.$$('table');
const allTr = table.querySelectorAll('tbody tr');
allTr.forEach((tr) => {
const selectedRow = this._findSelectableElement(tr.rowData);
if (selectedRow === value) {
const checkbox = tr.querySelector('paper-checkbox');
if (checkbox) {
checkbox.checked = false;
}
tr.classList.remove('selected');
}
});
this.splice('selectedRows', this.selectedRows.indexOf(value), 1);
}

_selectChange(event) {
let localTarget;
if (event.type && event.type === 'change') {
Expand Down