Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Example - Table with other widget #1492

Closed
wants to merge 2 commits into from
Closed

Example - Table with other widget #1492

wants to merge 2 commits into from

Conversation

dadokkio
Copy link
Contributor

Expanded table pagination example with interaction with other widget and filtered|total item count

based on: https://www.intothevoid.io/data-visualization/sortable-table-dc-js/

Expanded table pagination example with interaction with other widget and filtered|total item count
@gordonwoodhull
Copy link
Contributor

This looks like a nicer-styled version of the table pagination example, with a pie chart filtering it.

Maybe we should just replace the earlier example?

BTW, I noticed an issue. If you select two categories from the donut chart, then go the last page of the table and deselect one of the categories, you end up with a blank table, even though it says it is displaying data:

image

Paging up and then down again, the three rows show up.

I am not sure if this was always a problem with pagination or if it is specific to this example. (I also haven't tried to troubleshoot it yet.)

@dadokkio
Copy link
Contributor Author

Ok, thanks for the feedback. The easiest way to solve the issue is to reset the table index when you click on the other widgets. If not, I should subtract the number of hided rows from the other widget but I'm not sure how to do that.

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Nov 30, 2018

I was able to fix this by splitting update_offset and display, calling update_offset on preRedraw and display on pretransition. @HamsterHuey's code keeps beginSlice in bounds but it wasn't getting called in the right order in this PR.

In general it's easier to listen to the related chart's draw events rather than watching filtered on everything else.

I'm replacing the existing table-pagination example in 3.0.9, on a release branch for now, available sometime soon.

Thanks @dadokkio!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants