Skip to content

Commit 55ec6a3

Browse files
committed
Ui module fixes:
- Add multiselect.js new method that toggles page records and set it using in template and set up it in template file
1 parent 832bbae commit 55ec6a3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
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/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)