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

DataTable: hide column after reordering columns throws exception #668

Closed
Yousefjb opened this issue Dec 6, 2018 · 0 comments
Closed

DataTable: hide column after reordering columns throws exception #668

Yousefjb opened this issue Dec 6, 2018 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@Yousefjb
Copy link
Contributor

Yousefjb commented Dec 6, 2018

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Plunkr Case (Bug Reports)
tried to use plunkr but it refused to render

Current behavior
I can't toggle columns when reorderableColumns props is enabled and the columns has been reordered

Expected behavior
I can toggle columns when they are reodered

Minimal reproduction of the problem with instructions

getColumns() {
        let columns = React.Children.toArray(this.props.children);
        
        if(this.props.reorderableColumns && this.state.columnOrder) {
            let orderedColumns = [];
            for(let columnKey of this.state.columnOrder) {
                // <-- here
                // should check if findColumnByKey return column or undefined
                orderedColumns.push(this.findColumnByKey(columns, columnKey));
            }
                        
            return orderedColumns;
        }
        else {
            return columns;
        }
    }

Please tell us about your environment:

  • React version:
    ^16.6.3

  • PrimeReact version:
    ^2.0.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES6

@cagataycivici cagataycivici self-assigned this Dec 23, 2018
@cagataycivici cagataycivici added the Type: Bug Issue contains a defect related to a specific component. label Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants