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

Feature Request: How can we handle rowspan and colspan #21

Open
onesinus opened this issue Jun 3, 2019 · 4 comments
Open

Feature Request: How can we handle rowspan and colspan #21

onesinus opened this issue Jun 3, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@onesinus
Copy link

onesinus commented Jun 3, 2019

In table we can set rowspan and colspan, how about TableWindow?

Rowspan Colspan

@pupudu
Copy link
Owner

pupudu commented Jun 3, 2019

Hi @onesinus
This is something I was keen on doing as well. Unfortunately, there's no easy and trivial way to do that yet.

Even the primitive react-virtualized and react-window libraries don't support this feature yet.
See:

bvaughn/react-virtualized#123
bvaughn/react-window#60 (comment)

However, I'm still hopeful that I can find a way to do at least one of colspan and rowspan. I'll leave this issue open for now, and do some digging into the concepts to see if we can see some light.

@geyang
Copy link

geyang commented Jun 16, 2019

I think we really need a virtualized grid component in react, that supports colSpan, rowSpan, and sticky components. Some companies have internal versions that work supremely well. it is a shame nothing like those are available outside.

@pupudu
Copy link
Owner

pupudu commented Jun 16, 2019

Hi @episodeyang
Thanks for paying interest in this library and this issue.
I am actually willing to look into adding support for those 3 features. But for me, it's still unclear how the API would look like.

For example:
Where do you think we should define the respective colspan/rowspan attributes? Should it be in the data array itself? Should it be given as a separate data array? Is it possible to define it in column meta-data?

I am still doing research around these topics and haven't really found a decent solution so far. I'll check with Brian Vaughn to see if he has time to enlighten us with his point of view on the subject.

@pupudu pupudu added enhancement New feature or request help wanted Extra attention is needed labels Jun 16, 2019
@giiska
Copy link

giiska commented Feb 26, 2020

Some references for you:
This library has feature of cospan and it's based on react-window as well.
https://autodesk.github.io/react-base-table/examples/row-span

Some react ui library like antd define cospan as column prop

const columns = [
  {
    title: 'Name',
    dataIndex: 'name',
    render: (text, row, index) => {
      if (index < 4) {
        return <a>{text}</a>;
      }
      return {
        children: <a>{text}</a>,
        props: {
          colSpan: 5,
        },
      };
    },
  },

https://ant.design/components/table/#components-table-demo-colspan-rowspan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants