Bug
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
The first click should toggle the checkbox correctly.
it would be great to use md-checkbox with the datatable
latest Angular (2.1.2)
latest Angular 2 Material
latest angular2-data-table
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
also, there's a bug when 'rows' attribute is initialized in the
constructor, "cant read property length of undefined" in index.js:2154
(this.rows is undefined) but i will open a separate issue on that.
On Sat, Dec 3, 2016 at 7:00 PM, Austin notifications@github.com wrote:
Sounds good.
side note: I just released a new version with checkbox selection built in,
which might be what you were trying to do.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/swimlane/angular2-data-table/issues/333#issuecomment-264651244,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFyCRnV2e36miWRpYJAWbLa92tu6WRBrks5rEaAygaJpZM4LBipc
.
--
►►Rotem Meiri
[email protected]
facebook.com/rotemx
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.