HI All,
Application : Reactive Web
I am fetching data from API and showing in table. But table is showing all records even if pagination have implemented to show only 10 records. Below are details.
Is there something went wrong here? Please Advise.......
Rohan Hanumante wrote:
Hi Rohan,
In TotalCount property you should use COUNT runtime property to get total count of row of your aggregate not Length.
Thanks,
Sanjay
Sanjay Kumar Sahu wrote:
Hi Sanjay,
As there is no count attribute. as below.
Thanks..
what about your API itself? Does it support pagination ? Or does it always return the full list. If so, and you want for some reason to apply pagination, you'll have to add logic for only showing a given subset of what the api returns.
@Sanjay, this is not about aggregates.
Dorine
Dorine Boudry wrote:
Hi Dorine,
Yes, API is giving me full list. Yes, for that i am using "Navigation/Pagination" widget so that i can restrict records for one page by MAXRecord. But it shows me all the list at once.
Thanks....
Hi,
you need create a output variable with this logic:
In Screen (fetch from other source, you receive the output, assign to a variable:
cheers
that's your problem then. the navigation/pagination widget only offers the user an interface to move forward/backward through sets of retrieved data, it doesn't automagically alter the content of the returned list.
You'll have to write logic for that yourself if it is not supported by the API.
I'll make a quick demo, just a second
My earlier response was for aggregate, which you can't get with API.
Now, You have to create an action, from where you will have to call your API, then below that, you have to create a generic loop using ForEach to iterate though output list, and update Count output variable(Local variable) to get count of output rows. Now this Count var data you can use on TotalCount property.
Regards,
no need for loop to count how much records are in a list, just use length
here's the demo
Hope this makes it clear to you what is still missing in your module.
As the full list is returned, you don't even need to refresh the api fetch, you can just use a local list to display and change the bit from the fetch that you are showing.
One remark though, why exactly do you want to add pagination, as all data is immediately available, why only show it to the user in bits, there is no performance advantage ???
Remark : it is now pointing to my published api, it works today, but as soon as i throw it away, it's broken.
I am also using a list instead of an aggregate as the table's source, and although the demo is already broken as mentioned above, I copied the actions and modified to my specific variables and it worked superb. Thank you!!
Hi
@Dorine Boudry
Your Solution helped to me as well.
Thanks