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

Add master checkbox to Grid #1921

Merged

Conversation

mhuser
Copy link
Contributor

@mhuser mhuser commented Oct 28, 2022

fix #1877

Add a master checkbox into grid header that enables to toggle selection of whole visible records.

does not account the child checkbox states
@mhuser
Copy link
Contributor Author

mhuser commented Oct 29, 2022

I have a first working master checkbox but the code is ugly and it does not account for the indeterminate state if child checkboxes are changed.
I found this fomentic example
Would it be cleaner to use a separated javascript file?

@mvorisek mvorisek changed the title add master checkbox in grid header for addSelection Add master checkbox in grid header for addSelection Oct 29, 2022
@mvorisek
Copy link
Member

needs a Behat test

master checkbox must reflect the child states - unchecked/"partially checked"/"all checked"

if Fomantic-UI/jQuery cannot handle this in a few lines, the JS should be put into js/, but until you have fully working solution, feel free to keep the code uncompiled

@mhuser
Copy link
Contributor Author

mhuser commented Oct 29, 2022

image image

Ok, it works as of now with the indeterminate state if the child checkboxes are not all in the same state.

I had some issues to have the javascript statements to appear at the proper position. I first wrote them in Grid->addSelection() and they were called kind of before the checkbox() creation for fomantic-ui.

Still I feel the manner I use the javascript is not optimal because it does not look like other atk4/ui sources.

tests-behat/grid.feature Outdated Show resolved Hide resolved
tests-behat/grid.feature Outdated Show resolved Hide resolved
@mhuser
Copy link
Contributor Author

mhuser commented Nov 5, 2022

I did not find any figures of the checkbox column inside the Column/Checkbox or the Grid documentation.

There seem to be no documentation updates to do because the core functionalities of Grid and Column/Checkbox are not affected.

@mvorisek mvorisek force-pushed the add-master-checkbox-to-grid--addSelection() branch from 3dfe1b5 to 1b28c35 Compare March 30, 2024 11:32
@mvorisek mvorisek added the MAJOR label Nov 24, 2024
@mvorisek mvorisek merged commit de0e11c into atk4:develop Nov 24, 2024
25 checks passed
@mvorisek
Copy link
Member

@mhuser, thank for this great contribution and sorry for longer review! ❤

@mhuser
Copy link
Contributor Author

mhuser commented Nov 24, 2024

@mvorisek
You are welcome. This is great! 😃

@mhuser mhuser deleted the add-master-checkbox-to-grid--addSelection() branch November 24, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add checkbox to table header to select/unselect all
2 participants