Skip to content

Conversation

dtaylor113
Copy link
Member

@dtaylor113 dtaylor113 commented Jun 5, 2018

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 the ng-model value.
The only solution I could find is calling addNewComponentToDOM() 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:

table-select-all-w-filters

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,

  • Dave

@abkieling
Copy link
Contributor

Your solution is to remove and add the whole table using ngIf, correct? Did you try doing the same thing just for the checkbox?

@dtaylor113
Copy link
Member Author

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

@dtaylor113
Copy link
Member Author

@alexkieling do you have any issues with me merging this PR? -thanks

@abkieling
Copy link
Contributor

@dtaylor113 no issues, go ahead

@dtaylor113 dtaylor113 merged commit 9094b8c into patternfly:master Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants