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 - Column - Headercheckboxicon slot doesn't replace default content #7112

Open
1 of 4 tasks
barrierwill opened this issue Jan 17, 2025 · 0 comments
Open
1 of 4 tasks
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@barrierwill
Copy link

Describe the bug

When using the headercheckboxicon slot in a column in a datatable, the content I provide doesn't overwrite the default checkbox in the header.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/gcazntjp?file=src%2FApp.vue

Environment

Vue 3 with primevue v4.

Vue version

3.2.45

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a datatable with checkbox selection.
  2. Add slot to column with selection mode multiple where the slot is headercheckboxicon
  3. use the checked value from the slot in the template.
  4. You will see both the value of the checked state and the original checkbox the datatable provides.

Expected behavior

I expect the content in the headercheckboxicon to overwrite the default checkbox. It doesn't and both the default checkbox and the content I provide display at the same time. It should only display the content I put in the headercheckboxicon.

The reason why I am doing this is because I wanted to use the indeterminate checkbox to display whenever some of the rows (but not all) are selected in the datatable. I can't do that because of the fact the old checkbox is still there and because if I try to replace the checkbox with a checkbox that uses the checked value as the v-model. I get this error: v-model cannot be used on v-for or v-slot scope variables because they are not writable.
You can see that error here: https://stackblitz.com/edit/s3lawwws?file=src%2FApp.vue

I would also be happy with not using the headercheckboxicon slot if indeterminate was used for the headercheckbox whenever the user selects some of the rows but not all.

@barrierwill barrierwill added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 17, 2025
@barrierwill barrierwill changed the title Datatable - Column - Headercheckboxicon doesn't Datatable - Column - Headercheckboxicon slot doesn't replace default content Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant