Skip to content

Commit acd9947

Browse files
author
Stanislav Idolov
authored
ENGCOM-2711: [Forwardport] Improvements in UI component MassActions #17446
2 parents 728f29d + 730e1ea commit acd9947

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ define([
229229
return this;
230230
},
231231

232+
/**
233+
* Selects or deselects all records on the current page.
234+
*
235+
* @returns {Multiselect} Chainable.
236+
*/
237+
togglePage: function () {
238+
return this.isPageSelected() ? this.deselectPage() : this.selectPage();
239+
},
240+
232241
/**
233242
* Clears the array of not selected records.
234243
*

app/code/Magento/Ui/view/base/web/js/grid/massactions.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ define([
175175
* invoked if action is confirmed.
176176
*/
177177
_confirm: function (action, callback) {
178-
var confirmData = action.confirm;
178+
var confirmData = action.confirm,
179+
data = this.getSelections(),
180+
total = data.total ? data.total : 0,
181+
confirmMessage = confirmData.message + ' (' + total + ' record' + (total > 1 ? 's' : '') + ')';
179182

180183
confirm({
181184
title: confirmData.title,
182-
content: confirmData.message,
185+
content: confirmMessage,
183186
actions: {
184187
confirm: callback
185188
}

app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
data-bind="
1212
checked: allSelected(),
1313
attr: {id: ++ko.uid},
14-
event: { change: toggleSelectAll },
14+
event: { change: togglePage },
1515
css: { '_indeterminate': indetermine },
1616
enable: totalRecords">
1717
<label attr="for: ko.uid"/>

0 commit comments

Comments
 (0)