Closed dtaylor113 closed 6 years ago
Your solution is to remove and add the whole table using ngIf, correct? Did you try doing the same thing just for the checkbox?
Your solution is to remove and add the whole table using ngIf, correct?
Yes, in the demo code
Did you try doing the same thing just for the checkbox?
No, I haven't tried that. The 'Select All' checkbox is part of the transcluded HTML which is bound to underlying datatables.net component. Not sure ngif
there would help.
angular-datatables has an example of the select all checkbox, I was going to compare it to how it is implemented in angular-patternfly: http://l-lin.github.io/angular-datatables/archives/#!/rowSelect
@alexkieling do you have any issues with me merging this PR? -thanks
@dtaylor113 no issues, go ahead
Hi @alexkieling, The 'Select All' table checkbox seems to lose binding to the controller's 'toggleAll()' method after (a) clearing all or any one filter or (b) applying a second filter. I spent an entire afternoon trying to figure out why this is happening; trying many suggested solutions such as changing to
ng-click
or using an object for theng-model
value. The only solution I could find is callingaddNewComponentToDOM()
for the usecases mentioned above. This is not ideal, as the entire table is redrawn in those situations. However, the controller bindings continue to work after multiple filters are applied or cleared.As you can see, applying the first filter doesn't cause the table to be redrawn, however adding multiple filters or clearing filters will cause the redraw:
This is somewhat of a work-around as nothing has changed in the actual TableView component, just in the ngDoc example, so feel free to use the suggested solution if it's acceptable to you.
Fixes #740 ? :-)
Thanks,