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

Columns in the column store may not reflect the order they appear in visually #3238

Closed
ExtAnimal opened this issue Jul 29, 2021 · 0 comments
Closed
Assignees
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@ExtAnimal
Copy link

So visibleColumns[0] may not be the first visible column. If a column with locked : true is specified after a column which has no locked or region property, or is region : 'normal'.

This is because they are ordered by the order in which sub grids are rendered which itself is by coincidence that "locked" sorts before "normal".

Change the groupedheaders example's columns spec to be

    columns : [
        {
            text     : 'Contact',
            children : [
                { text : 'First name', field : 'firstName', width : 150 },
                { text : 'Surname', field : 'surName', width : 150 },
                { text : 'City', field : 'city', width : 150 }
            ]
        },
        {
            text     : 'Favorites',
            children : [
                { text : 'Food', field : 'food', flex : 1 },
                {
                    text       : 'Color',
                    field      : 'color',
                    flex       : 1,
                    htmlEncode : false,
                    renderer   : ({ value, cellElement }) => {
                        cellElement.innerHTML = StringHelper.xss`<div class="color-box"></div>${value}`;
                        cellElement.firstElementChild.style.backgroundColor = value;
                    }

                }
            ]
        },
        { text : 'Customer#', field : 'id', width : 150, locked : true, editor : false },
    ],

And tabbing into the grid shows:

Screenshot 2021-07-29 at 09 43 06

As you see, when it by default focuses column 0, that is "First Name", because that is the first column in the store.

Columns have to be sorted into region order, so that they conform to their visible indices.

@ExtAnimal ExtAnimal added the bug Something isn't working label Jul 29, 2021
@ExtAnimal ExtAnimal self-assigned this Jul 28, 2022
@ExtAnimal ExtAnimal added in progress ready for review Issue is fixed, the pull request is being reviewed resolved Fixed but not yet released (available in the nightly builds) and removed in progress ready for review Issue is fixed, the pull request is being reviewed labels Jul 28, 2022
@SergeyMaltsev SergeyMaltsev added this to the 5.1.2 milestone Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants