How to fetch selected rows from a mat-table selection
Asked
Active
Viewed 6,196 times
4
-
Take a look at: https://stackoverflow.com/q/47051485/7124761 – Prashant Pimpale Jun 29 '18 at 14:36
-
@PrashantPimpale thank you, but how to get array of items checked .. – Varsha Bommarabettu Jun 29 '18 at 14:43
-
Bind the value with ngmodule – Prashant Pimpale Jun 29 '18 at 15:12
-
This will give a collection of objecta – Prashant Pimpale Jun 29 '18 at 15:13
1 Answers
13
You can get the selected
or checked
item of Material Selection Table by using:
this.selection.selected
this will gives you the checked items from the table.

Prashant Pimpale
- 10,349
- 9
- 44
- 84
-
Hello, after retreiving the checked items, how can I uncheck items? For example, i am trying to avoid items from being checked after 15 items, but when i reach the item number 15 i can prevent from being added to the list, but i cannot avoid the check on that item, how can i avoid items from being checked after the item number 15? – Jonny May 22 '19 at 02:31
-
-
@Jonny Can you show me the code? Or Stackblitz example so I can check there – Prashant Pimpale May 22 '19 at 05:07
-
Thanks for your response, i already did it, but now i have the problem that i cannot retrieve the selected items when i return and load them from the backend, the list keep showing that none is selected. – Jonny May 22 '19 at 19:30