Add option to disable checkedRowStatus

This commit is contained in:
Faris Ansari 2018-03-13 10:36:41 +05:30
parent 0a402b3f38
commit 51a8f0dd83

View File

@ -33,7 +33,7 @@ export default class RowManager {
} }
bindCheckbox() { bindCheckbox() {
if (!this.options.addCheckboxColumn) return; if (!this.options.checkboxColumn) return;
// map of checked rows // map of checked rows
this.checkMap = []; this.checkMap = [];
@ -124,9 +124,11 @@ export default class RowManager {
} }
showCheckStatus() { showCheckStatus() {
if (!this.options.checkedRowStatus) return;
const checkedRows = this.getCheckedRows(); const checkedRows = this.getCheckedRows();
if (checkedRows.length > 0) { const count = checkedRows.length;
this.bodyRenderer.showToastMessage(checkedRows.length + ' rows selected'); if (count > 0) {
this.bodyRenderer.showToastMessage(`${count} row${count > 1 ? 's' : ''} selected`);
} else { } else {
this.bodyRenderer.clearToastMessage(); this.bodyRenderer.clearToastMessage();
} }