Closed diegoberges closed 5 years ago
Set:
<table md-table multiple="true">
View more demo here: https://codepen.io/anon/pen/OZVMJg?editors=1010
I need to select all the elements of all the pages, not just the first one.
Not support now. You have to do it by yourseft.
Do you have any example to try it??
Simple example:
vm.selectAllRows = function () {
// pre selection of all rows
vm.dataGrid.dataSet.forEach(function (item) {
// set value in mdTableNgModel;
vm.selectedRow.push(item);
});
};
// Do not do this: angular.copy (vm.dataGrid.dataSet, vm.selectedRow);
// Also do not do this: vm.selectedRow = vm.dataGrid.dataSet;
// I had referral issues between the instances of the dataset object when I assigned the value to the //NgModelAttribute of mdTableElement because when I unchecked the row mdRowCheckbox
// the item was automatically removed from the table.
Sorry, you can explain your idea?
I'm editing the file md-data-table.js but I can`t select all rows, I can only select the raws that there are in the first page of table.
Thanks
@diegoberges The variable assigned to the ngModel attribute contains all selected rows from the table, so the idea is basically to copy all items from the dataSource to ngModel, this will tell the table that such rows are selected.
Thanks!
When I have a lot of rows, and I have pagination, y can only check the rows in the active view.
How can I select all rows? it's possible?