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

How can I have each row perform different merge cell logic? #401

Open
doubleKGe opened this issue Mar 17, 2023 · 3 comments
Open

How can I have each row perform different merge cell logic? #401

doubleKGe opened this issue Mar 17, 2023 · 3 comments

Comments

@doubleKGe
Copy link

hello, I have a statistical row in my table, and I don't want it to merge cells, so what do I need to do?

@doubleKGe
Copy link
Author

I have solved my problem

@doubleKGe
Copy link
Author

I used to combine all the data into a single line to achieve different merge logic for different lines, but I found that this would have performance issues - there was no way to do local rendering (because there was only one line), so was it possible to implement different rendering logic for each row or group? I want to be able to merge the relevant parts of the cells into a function, passing in the number of the group to be rendered, so that dynamic rendering logic can be used, or passing in a list, so that each group can be merged with a different logic.

For example

body: [
    // Group1
    [
        // line1
        [
            { field: "personid", rowSpan: 2 },
            { field: "fname" },
            { field: "email", rowSpan: 2 },
            { field: "date", rowSpan: 2 },
        ],
        // line2
        [{ field: "lname" }]
    ],
    // Group2
    [
        // line1
        [
            { field: "personid" },
            { field: "name", rowSpan: 2 },
            { field: "email" },
            { field: "date" }
        ],
        // line2
        [
            { field: "personid" },
            { field: "email" },
            { field: "date" }
        ]
    ],
    ...
]

@doubleKGe doubleKGe reopened this Jul 10, 2023
@ota-meshi
Copy link
Member

Thank you for posting this issue.
The current cheetah-grid does not have the ability to change the layout for each row of the body.
Maybe it's possible to use themes as in #62 to make it look like that virtually.
If that doesn't work, you may need to create your own grid component by extending cheetahGrid.core.DrawGrid.

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

No branches or pull requests

2 participants