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

TreeTable | selectionKeys support for checkbox selection mode #15216

Closed
cetincakiroglu opened this issue Apr 3, 2024 · 0 comments · Fixed by #15217
Closed

TreeTable | selectionKeys support for checkbox selection mode #15216

cetincakiroglu opened this issue Apr 3, 2024 · 0 comments · Fixed by #15217
Assignees
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team LTS-FIXED-16.9.8 PRO Support Issue was reported by PRO User Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@cetincakiroglu
Copy link
Contributor

cetincakiroglu commented Apr 3, 2024

  • New input property selectionKeys will be added to improve selection logic in checkbox selection mode.

Usage:
Users must use dataKey property along with the selectionKeys to build a context between the selection and data of the component. Corresponding dataKey value of the element can be placed inside the data object or outside.

// template
<p-treeTable [(selectionKeys)]="selectionKeys" dataKey="key">
    ....
</p-treeTable>

// ts
selectionKeys = {'0': {checked: false, partialChecked: true}, '0-1': {checked: true, partialChecked: false}}

example data:

{
    key: '0',
    data: {
        name: 'Applications',
        size: '100kb',
        type: 'Folder'
    },
    children: [
     ....
        {
            key: '0-1',
            data: {
                name: 'editor.app',
                size: '25kb',
                type: 'Application'
            }
        }
    ]
}

selectionKeys is not compatible with legacy selection property, users should choose one of them
selection property will be deprecated in the future and all selection logic will handle by selectionKeys

For the performance concerns children elements will not automatically selected on the initial load if parent's key provided in selectionKeys. All keys of the elements should be provided in selectionKeys.

@cetincakiroglu cetincakiroglu added Type: New Feature Issue contains a new feature or new component request Core Team Issue or pull request has been *opened* by a member of Core Team PRO Support Issue was reported by PRO User labels Apr 3, 2024
@cetincakiroglu cetincakiroglu added this to the 17.13.0 milestone Apr 3, 2024
@cetincakiroglu cetincakiroglu self-assigned this Apr 3, 2024
@cetincakiroglu cetincakiroglu changed the title TreeTable | selectIonKeys support for checkbox selection mode TreeTable | selectionKeys support for checkbox selection mode Apr 3, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 3, 2024
@cetincakiroglu cetincakiroglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team LTS-FIXED-16.9.8 PRO Support Issue was reported by PRO User Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants