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 to use tui-grid checbox react version #2076

Open
junevil2004 opened this issue Oct 22, 2024 · 0 comments
Open

how to use tui-grid checbox react version #2076

junevil2004 opened this issue Oct 22, 2024 · 0 comments
Labels

Comments

@junevil2004
Copy link

const columns = useMemo(() => {
return columnData.map(col => {
const column = {
header: col.header,
name: col.name,
minWidth: col.width || 100,
readOnly: col.readOnly === undefined ? true : col.readOnly,
sortable: col.sort === undefined ? true : col.sort,
className: col.readOnly === undefined ? '' : 'tui-grid-cell--read-only',
hidden: col.hidden || false,
align: col.align || 'center',
editor: col.editor ? col.editor : false,
};

        if (col.readOnly) {
            column.editor = false;
        } else {
            if (col.editor === 'checkbox') {
                column.editor  = 'checkbox'
            } else if (col.editor === 'select') {
                column.editor = {
                    type: 'select',
                    options: {
                        listItems: col.options || [],
                    },
                };
            }else{
                column.editor = col.editor || 'text';
            }
        }
        return column;
    });
}, [columnData]);

I've tried using the checkbox option in the renderer and the editor option, but it doesn't work. Is there a way to use it in the react version?

리엑트로 tui-gird를 사용하고있는데 왜 옵션을 renderer랑 editor 둘다 사용해봤는데 작동을 안해요 ㅠㅠ 어떻게 사용해야하나요..

Version
4.21.22

"tui-grid": "^4.21.22",
"tui-pagination": "^3.4.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@junevil2004 and others