Open rotemx opened 7 years ago
I'm not sure what your code looks like (is there a way to view it from that plunk link?). However, I had this problem when using md-checkbox. The solution was to bind to the change
event instead of the click
event that you would typically use on a native checkbox.
<md-checkbox (change)="changed()"></md-checkbox>
@dsbert thank you the workaround worked ! but it's still a bug, so I'm leaving the issue open. you can see the code here: https://plnkr.co/edit/HGUjy5
Sounds good.
side note: I just released a new version with checkbox selection built in, which might be what you were trying to do.
hi, thanks for the info. any idea on how I can change the select checkbox to angular material's
Plz open a ticket for that.
If you wanted to use material checkbox, just use it like you want any other custom control and handle selection yourself.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
When using native checkboxes with Angular2-Data-Table, I can toggle columns on or off the table.
When trying to implement Angular2 Material Design's md-checkbox the first click doesn't work - the checkbox remains checked.
After the first click the checked value is opposite to the model, i.e. opposite to the native checkboxes.
I tried many ways to fix this but without luck. I don't know whether this is a bug in md-checkbox or in angular2-data-table.
In the plunker the code from the demo, and added md-checkboxes in addition to the native ones: https://plnkr.co/edit/HGUjy5
What is the current behavior?
The first click should toggle the checkbox correctly.
What is the use-case or motivation for changing an existing behavior?
it would be great to use md-checkbox with the datatable
Which versions of Angular, Material, OS, browsers are affected?
latest Angular (2.1.2) latest Angular 2 Material latest angular2-data-table