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

Dynamically disable checkbox/selection in Table #324

Closed
cagataycivici opened this issue May 17, 2020 · 14 comments
Closed

Dynamically disable checkbox/selection in Table #324

cagataycivici opened this issue May 17, 2020 · 14 comments
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@cagataycivici
Copy link
Member

cagataycivici commented May 17, 2020

Same as the disabledSelection as in PrimeFaces.

@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label May 17, 2020
@cagataycivici cagataycivici self-assigned this May 17, 2020
@cagataycivici cagataycivici changed the title Dynamically enable-disable checkboxes in Table Dynamically disable checkbox/selection in Table Jul 4, 2020
@avbentem
Copy link

Aside, in PrimeFaces, this is handled by disabledSelection on both column and on the table itself:

Disables row selection when true. Overrides p:column's disabledSelection attr. Example: var="xxx" disabledSelection="#{xxx.year > 1960}"

@arnyee
Copy link

arnyee commented Oct 26, 2021

Hello, I would like to know if this feature will be added to any of the milestones soon?

@may820806
Copy link

may I ask is this issue still developing?

@levitomer
Copy link

Same here

@musaq
Copy link

musaq commented Aug 30, 2023

still going on?

@Hulkmaster
Copy link

wow, still not there?

@lbeougher
Copy link

@cagataycivici Is this going to be fixed ever?

@mr83-uw
Copy link

mr83-uw commented Oct 4, 2023

I've been able to use this hack as a work around.

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

By adding a directive to the :rowClass="disableRow" to a function that return 'p-disabled' if you want that row disabled.

@JackHimes
Copy link

@mr83-uw Bless your soul child 🙏 - worked like a charm!

@emredenizozer
Copy link

@cagataycivici I think that this functionality is a must-have and you need to implement it sooner. Otherwise selection process would be a nightmare for the developers that use primevue.

@cagataycivici
Copy link
Member Author

Issue tracker is used for defects only as part of our commitment to quality and continuous improvement in all areas. Enhancements are collected as valuable community feedback and managed internally so moving this enhancement ticket to our internal project management backlog.

@1Map
Copy link
Contributor

1Map commented Dec 31, 2023

I've been able to use this hack as a work around.

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

By adding a directive to the :rowClass="disableRow" to a function that return 'p-disabled' if you want that row disabled.

This does not work as it completly disable the whole row and not just the checkbox. In my case I also have an Action column with some buttons (for example pencil icon that edits the record). I only want to disable the checkbox and not the whole row.

@DileepSArjun
Copy link

@1Map I have made a demo where the checkbox alone is disabled. This makes the action buttons work as per your use case.
See: https://stackblitz.com/edit/3z633b?file=src%2FApp.vue

@Dagarkin
Copy link

I've been able to use this hack as a work around.
https://stackblitz.com/edit/ky1gjk?file=src%2FApp.vue
By adding a directive to the :rowClass="disableRow" to a function that return 'p-disabled' if you want that row disabled.

This does not work as it completly disable the whole row and not just the checkbox. In my case I also have an Action column with some buttons (for example pencil icon that edits the record). I only want to disable the checkbox and not the whole row.

You can add a css class to the column.

:deep(.enablecolumn) { cursor: default; pointer-events: auto; user-select:auto }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests