infor-design / enterprise-ng

Angular wrappers for IDS Enterprise components
Apache License 2.0
55 stars 82 forks source link

Datagrid: Want to disable the selection checkbox by conditions #1689

Open charantejpola opened 2 months ago

charantejpola commented 2 months ago

Describe the bug Using selection checkbox in a DataGrid, I have a requirement where I need to disable the selection checkbox on some conditions, which I am able to by setting the isEditable as true/false. Even though I have disabled them I am still able to select them on click.

To Reproduce Steps to reproduce the behavior:

  1. Create a datagrid with column formatter as selection checkbox
  2. The column has isEditable being set as true/ false by a function
  3. You can see the selection checkboxes disabled
  4. But still able to select them

Expected behavior We expect the selection checkboxes not be selected as well as the contextual toolbar shall not be triggered as well.

Version

Screenshots Will be attaching a video for reference

Platform

Additional context Here is the example stackblitz. https://stackblitz.com/edit/ids-quick-start-1761-ctlunk?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

https://github.com/infor-design/enterprise-ng/assets/144307117/291ff234-f67e-42df-bbe7-8592835df747

charantejpola commented 1 month ago

Need to add one more point that select all check box should only check those checkboxes which are not disabled. As of current implementation it selects rows which are disabled as well

sami1riaz commented 1 day ago

Hi, is there an estimate of when this bug will be fixed and if it can be backported to version 15.6.1? We cannot release the feature we are working on without this fix unfortunately. Our deadline is August 6, 2024

tmcconechy commented 1 day ago

I can add this to this sprint and it would be done around Aug.6th release we usually release between 5-9th of every month. However for patches could do those right away.

We can try to backport it when it is complete, I'm not sure if 15.6.1 is possible to build anymore but can give it a try

tmcconechy commented 1 day ago

@charantejpola @sami1riaz

I fixed on the attached PR https://github.com/infor-design/enterprise/pull/8882 please review if you can. Our QA will test it and when merged i can attempt to patch 15.6.1

sami1riaz commented 13 hours ago

@tmcconechy, thanks for the quick fix. I noticed that the fix was in enterprise repo. Will it also be applied to enterprise-ng?

tmcconechy commented 13 hours ago

@sami1riaz The fix is only in the enterprise part. Can you apply a patch if we just patch to the enterprise version? Or do you need some combined NG and EP version patched?

LilBiggs commented 12 hours ago

Hey Tim, WFM references the Angular version. So whatever jQuery IDS version is referenced by the ids-enterprise-ng package is what will be pulled in. Is it possible to bump the NG version and update the ids-enterprise that is referenced within the ng version?

tmcconechy commented 12 hours ago

Yes, will do which version do you need patched exactly? 15.6.x correct?

sami1riaz commented 12 hours ago

Yes, we are currently using "ids-enterprise-ng": "15.6.1"

tmcconechy commented 9 hours ago

ok @sami1riaz do i need to look at that button disabled thing? (im not sure what that looks like) or is this good as is to patch?

sami1riaz commented 8 hours ago

What I was referring to is the disabled?: SohoDataGridColumnDisabledFunction attribute. I still don't fully understand why that attribute doesn't work with Soho.Formatters.SelectionCheckbox but works with other formatters like Soho.Formatters.Button.

If this solution works, I am fine with getting it patched. But to me for disabling a checkbox we should be using the disabled attribute.