Skip to content

Conversation

@andrewseguin
Copy link
Contributor

@andrewseguin andrewseguin commented Dec 2, 2017

To be added later: expanding rows (using when predicate), customizing column widths, adding/removing data, dynamic columns (add/remove/move), trackBy

(this was opened before at #8162 and was accidently closed, whoops - all feedback from there has been incorporated)

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 2, 2017
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added docs This issue is related to documentation pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Dec 8, 2017
@mmalerba mmalerba merged commit 97b1269 into angular:master Dec 8, 2017
@DavidJohnWilliams
Copy link

Hi, @andrewseguin.

Regarding your initial post:

To be added later: expanding rows (using when predicate), customizing column widths, adding/removing data, dynamic columns (add/remove/move), trackBy

Are you saying those things are all possible with the current table and just not documented? There are a lot of questions surrounding these issues on Gitter (and here).

I'd be happy to knock up some docs and stackblitz samples for these things if I can get a pointer about what you guys consider the correct way.

Currently I am:

  1. Adding/removing columns using matHeaderRowDef (can be updated dynamically).
  2. Customizing column widths using angular/flex-layout (can provide examples using css).
  3. Adding removing data by updating MatTableDataSource.data. Although I note that modifying the array does not trigger the BehaviourSubject. At the moment I have opted to set the filter to the current filter which triggers the updateChangeSubscription. I doubt this it the best way, I think it could be worth adding a refresh() function or similar mechanism to the table source?
  4. Track by can just use CDK [trackBy]. There are already some docs about this but I can write an example.
  5. Not really sure what you mean about row expansion?

Let me know if it would be helpful for me to start writing these docs or if there are already plans?

@andrewseguin
Copy link
Contributor Author

@DavidJohnWilliams These are all possible and just not documented. You're welcome to submit changes/fixes to the docs, though I'd base it off this PR since it moves some things around: #9489

@andrewseguin andrewseguin deleted the table-updated-docs branch April 17, 2018 17:23
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants