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 ability to hide columns and/or rows #1006

Closed
juliusdanek opened this issue Mar 7, 2022 · 4 comments · Fixed by #1012
Closed

Add ability to hide columns and/or rows #1006

juliusdanek opened this issue Mar 7, 2022 · 4 comments · Fixed by #1012
Milestone

Comments

@juliusdanek
Copy link

Is your feature request related to a problem? Please describe.
Add ability to hide columns and/or rows. This is achievable via batch_update using the request body below.

        "updateDimensionProperties": {
            "range": {
                "sheetId": tab_id,
                "dimension": dimension,
                "startIndex": start_index,
                "endIndex": end_index,
            },
            "properties": {
                "hiddenByUser": True,
            },
            "fields": "hiddenByUser",
        }
    }```
@lavigne958
Copy link
Collaborator

Hi @juliusdanek

I tried it, it works like a charm, I can certainly add this to the next release (will be 5.3.0).

@lavigne958 lavigne958 added this to the 5.3.0 milestone Mar 7, 2022
@juliusdanek
Copy link
Author

Awesome! Thank you. I don't think you need to return the "fields". Works well though.

@lavigne958
Copy link
Collaborator

I don't think you need to return the "fields"
sorry, I don't understand your point

Most if it's not every requests in gspread return the response from the API call to the user.

In this request we must set the value for the entry fields otherwise the API request is not valid.

@juliusdanek
Copy link
Author

Ah got it! My bad :) Anyway, thanks for adding this!!

lavigne958 added a commit that referenced this issue Mar 18, 2022
Add new method that allows the user to explicitly hide rows or columns.
Ass new method that allows the user to explicitly unhide rows or
columns.

This feature does not include any _listing_ method, because the listing
is not in the metadata of the `SpreadSheet` or the `Sheet`, it will
require to list all the data in the sheet and list all of them
then check if the flag `hiddenByUser` is set. This is a lot of
processing and with very large data set this can take some time
For a result that is only visible using the UI.

closes #1006
lavigne958 added a commit that referenced this issue Mar 18, 2022
Add new method that allows the user to explicitly hide rows or columns.
Ass new method that allows the user to explicitly unhide rows or
columns.

This feature does not include any _listing_ method, because the listing
is not in the metadata of the `SpreadSheet` or the `Sheet`, it will
require to list all the data in the sheet and list all of them
then check if the flag `hiddenByUser` is set. This is a lot of
processing and with very large data set this can take some time
For a result that is only visible using the UI.

closes #1006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants