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

Add option to hide the "indent" when grouping a grid #595

Open
GeoMarkou opened this issue May 25, 2020 · 2 comments
Open

Add option to hide the "indent" when grouping a grid #595

GeoMarkou opened this issue May 25, 2020 · 2 comments
Labels
Discussion Technical discussion, questions, input needed Enhancement New feature of an existing functionality or an improvement of an existing functionality pkg:Grid

Comments

@GeoMarkou
Copy link

I'm submitting a...

  • Suggestion for improvement

Current behavior

When you add a grouping to a grid it indents all the rows by 32 pixels.

Expected behavior

Set an option in GridGroupableSettings, similar to footer:visible maybe indent:none and be able to hide the indent cell.

Minimal reproduction of the problem with instructions

This is a very simple example of the problem - in a container of exactly 300 pixels, as you can see the grid is 332 pixels due to the indent, and it breaks the layout. If you remove the grouping the layout is fixed again.

https://stackblitz.com/edit/react-a337ft

What is the motivation or use case for changing the behavior?

We have a Grid in a part of the site where space is very restricted. This is to be displayed on an iPad where every pixel of screen space counts. Recently we added grouping to the grid to make it easier to read, but it broke the layout. We can't use grouping in parts of the site due to this issue.

Browser:

  • Chrome (desktop) version 83.0.4103.61 (Official Build) (64-bit)

System:

  • Platform: Windows
@simonssspirit simonssspirit added Discussion Technical discussion, questions, input needed Enhancement New feature of an existing functionality or an improvement of an existing functionality pkg:Grid labels May 28, 2020
@GeoMarkou
Copy link
Author

Any update on this one? I've been using this as a workaround in various areas but it's quite verbose to add everywhere we use grouping.

// TODO remove this once you can disable the grouping indent
React.useEffect(() => {
    if (!FormRef.current) {
        return;
    }

    // Hide the first column
    const colGroupEle = FormRef.current.querySelector('colgroup');
    if (!colGroupEle) {
        return;
    }

    const colEle = colGroupEle.children[0] as HTMLTableColElement;
    if (!colEle) {
        return;
    }
    
    colEle.width = '0px';
});

@wiznotwiz
Copy link

I'd also be interested in this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Technical discussion, questions, input needed Enhancement New feature of an existing functionality or an improvement of an existing functionality pkg:Grid
Projects
None yet
Development

No branches or pull requests

3 participants