Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

headerRenderer will execute multiple times when the columns has frozen: 'left' and frozen: 'right' #25

Closed
dingchaoyan1983 opened this issue May 7, 2019 · 3 comments
Labels
question Would be helpful to the others

Comments

@dingchaoyan1983
Copy link

dingchaoyan1983 commented May 7, 2019

As the title mentioned, when I have a table and the columns not only contains the left frozen columns, but also the right frozen columns, because I want to merge some columns in header, like this example https://autodesk.github.io/react-base-table/examples/multi-header, so I need implement the callback headerRenderer, but this callback will be called 3 times, and there is no indicator which is left table main table, and right table, in user's (developer who use this component) view, I think this function will be called one time only, because there is only one header.

@nihgwu
Copy link
Contributor

nihgwu commented May 7, 2019

That's a good question, as internally there are 3 tables to implement the column frozen feature, so it would be called 3 times, not sure what kind of feature you want to implement, but I'd say it's easy to determine which table is calling it and it's intended not passing it to the callback, maybe I would add it if it's really needed, I just don't want to bloat the API, for example you could just check the first column from columns if it's frozen and which direction it is, and you will know which table is calling the renderer

In my practice, I always take those tables as the same, and don't care about which table is calling the renderer, I guess you want implement something like column groups? I could share with a screenshot of the advanced table component we are using internally which is built on BaseTable with much more features, including grouping, selection, columns settings, columns reordering and column groups
image

@nihgwu nihgwu added the question Would be helpful to the others label May 7, 2019
@nihgwu
Copy link
Contributor

nihgwu commented May 7, 2019

I'm not sure if the column grouping feature should be builtin the BaseTable, as it's a userland feature IMO, but I will provide some snippets first

@dingchaoyan1983
Copy link
Author

I am understood what you said, thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Would be helpful to the others
Projects
None yet
Development

No branches or pull requests

2 participants