akveo / ng2-smart-table

Angular Smart Data Table component
https://akveo.github.io/ng2-smart-table/
MIT License
1.63k stars 879 forks source link

Fetching the data of Multiselect #495

Open maheshp212 opened 7 years ago

maheshp212 commented 7 years ago

I am trying to implement the Multi select option https://github.com/akveo/ng2-smart-table/blob/master/src/app/pages/examples/various/basic-example-multi-select.component.ts

this is working fine.. but unable to know how to fetch the data of the selected rows.

64n35h4 commented 7 years ago

check 'userRowSelect' and implement what you want it to do..

Bhole007 commented 7 years ago

I was facing the same issue. How to fetch data from selected rows. Here I found the solution :

in view use : (userRowSelect)="onUserRowSelect($event)"

in component : onUserRowSelect(event){ console.log(event.selected) }

Thanks @NordRagnarok

ccruza commented 5 years ago

Hello @Bhole007

I just copied your code, but i'm getting this error:

ERROR TypeError: Object doesn't support property or method 'onUserRowSelect'

Can you please help me?

UPDATED Set public to method "onUserRowSelect", then it would be:

public onUserRowSelect(event){ console.log(event.selected) }

hope4555 commented 4 years ago

in typescript (userRowSelect)="onUserRowSelect($event)"

onUserRowSelect(event): void { }