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

Pagination with dynamic row count display? #46

Open
davoutuk opened this issue Apr 13, 2020 · 2 comments
Open

Pagination with dynamic row count display? #46

davoutuk opened this issue Apr 13, 2020 · 2 comments

Comments

@davoutuk
Copy link

Does 'Ornamentum' support the idea of flexing the number of rows to display according to the available vertical space?

I want to implement a paginating table where the rows displayed in the table vary according to how much vertical space is available as the browser window flexes size.,

@yohangz
Copy link
Owner

yohangz commented Apr 15, 2020

@davoutuk, you can do that by setting the page size depending on the viewport based breakpoint and dynamically invoking the data-bind. You can use ResizeObserver for this purpose.

https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver

@davoutuk
Copy link
Author

Can you provide an example? I can't get this to work

I've tried setting the 'contentHeight' attribute to an observer that is linked to the ResizeObserver event, but this does not work

<ng-data-table
[id]="'simpleList'"
[showHeader]="false"
[pageable]="true"
[showRowSelectCheckbox]="true"
[contentHeight]="tableHeight$"
[dataSource]="tasks$"
[width]="500"
appResizeSlave>

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

No branches or pull requests

2 participants