budibase icon indicating copy to clipboard operation
budibase copied to clipboard

Data Provider should hide Pagination if Empty.

Open poirazis opened this issue 2 years ago • 4 comments

There should be an option ( or default behavior ) of the Data Provider Component, to hide its Pagination section if it has no rows.

Screenshot 2022-09-18 at 5 00 36 PM

poirazis avatar Sep 18 '22 14:09 poirazis

You can set it. Go to properties -> Conditions (all the way down) -> create new -> select Update setting -> Paginate -> set false (untick) -> create condition - data provider rows count < 0 or something like that

martkaczmarek avatar Sep 18 '22 15:09 martkaczmarek

hey @martkaczmarek and thanks for the tip !

P.S it seems you cannot create Conditional rule on a Data Provider referencing itself. The bindings aren't available. my Data Provider is called dpAreas. When in Conditional UI, its not available in the list of bindings.

poirazis avatar Sep 18 '22 15:09 poirazis

Yeah, I can see now that when I tried it I can't reference the component's self values. You could reference a State which would be updated with data provider's row count, but again - we can't do it automatically. We're seriously lacking:

  1. Ability to reference other objects' values - either from inside, or outside;
  2. Ability to run actions on page launch, on data provider refresh, on form elements click (not change) etc. EDIT: As I can see, you also referenced my point 2. in #7818

martkaczmarek avatar Sep 18 '22 15:09 martkaczmarek

@poirazis I have an idea for a workaround: Create two identical data providers, one inside the other. Apply the same filtering and data for both of them, and move your contents to the Child one. image Turn off the pagination in the parent. Create the conditional pagination in the Child. In the child's condition, you can reference the parent row count. image

martkaczmarek avatar Sep 18 '22 20:09 martkaczmarek

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Nov 27 '22 07:11 stale[bot]