Tradeshift / tradeshift-ui

Tradeshift UI is a framework-agnostic JavaScript library to help Tradeshift App developers to create cohesive user experiences and to provide reusable UI components.
https://ui.tradeshift.com
Other
33 stars 44 forks source link

Ability to define a static number of items per page in table component #297

Closed lloydhumphreys closed 7 years ago

lloydhumphreys commented 7 years ago

Feature request

Description of feature

It would appear that the current table will load as many lines as will fit in the viewport.

DUI would appreciate a property that allows us to set a static number of lines per page. This is so that we can be sure to bounce the user back to the correct page when they hit back, and make sharing the table easier.

We would love it if this could be done early in D3 so we can have it when we are building the new Document Manager :-)

wiredearp commented 7 years ago

The behavior you describe is not default, it is enabled by calling table.maximize(). If you don't call this method, the table defaults to setting a static number of rows per page as specified by the max and size methods (see http://ui.tradeshift.com/#components/table/paging.html).

Let us know if you can manage to style this to still appear "maximized" (assuming that this is still desired). I hope you will just need to set width and height to 100%.

Maybe an alternative feature request could be an API for showing a specific row index (since this remains fixed while the number of pages and current page change on window resize), but then again, I guess it's hard to know which row the user was actually looking at before he changed page or decided to share.

lloydhumphreys commented 7 years ago

Ah, I missed that. Thank you!