Dynamic Table Records Line Count according to screen size

Hi Everyone

I am currently sitting with an issue where I would like my table of records to fill an entire screen. In order to do this I would have to calculate the number of items that can fit on a screen and then use that value for the table records line count property.

Is this possible at all to do using Outsystems 10

Regards

Shaun

Hi Shaun,

First, I think there is no ready to use server action to this.
But you could use JavaScript to fetch that information. For example, see here (the selected answer).

Question is: Are you sure that this is worth the work you will have?
In general, there is no reason to show a lot of records (even if there is space in the screen).
My approach is to work with a search toolbar that will be much more useful to the user, associated with pagination.

No more than 10 or 15 records at a time.

Cheers.

Eduardo Jauch wrote:

Hi Shaun,

First, I think there is no ready to use server action to this.
But you could use JavaScript to fetch that information. For example, see here (the selected answer).

Question is: Are you sure that this is worth the work you will have?
In general, there is no reason to show a lot of records (even if there is space in the screen).
My approach is to work with a search toolbar that will be much more useful to the user, associated with pagination.

No more than 10 or 15 records at a time.

Cheers.

Hi Eduardo

I have used javascript to get the screen size, but this does not help me in any way to calculate the number of items to show in the line count of the table. Unless there is some way that I am not aware of but I have tried many ways using javascript to try and solve this problem.

Currently I have the item count set to 10 and also have a built in feature where a user can change this amount for his profile. But this is something that the client wants to happen automatically for each screen size that the users might be using.

Regards

Shaun


Hi Shaun,

Though it's theoretically possible to calculate, the client must also understand it comes with a performance penalty when resizing the screen (the data must be refetched). Also, this is, afaik, very uncommon in web apps, so I'm wondering why your client wants this feature.

Kilian Hekhuis wrote:

Hi Shaun,

Though it's theoretically possible to calculate, the client must also understand it comes with a performance penalty when resizing the screen (the data must be refetched). Also, this is, afaik, very uncommon in web apps, so I'm wondering why your client wants this feature.

Hi Kilian

How would one go about calculating this and insert the calculated value into the line count property of the table widget? I know how to calculate size in Jquery, but have no idea how one would get this value into the table widget.

Regards

Shaun


# on server side, you can assign the count value with data from database, site property, session variable

# so, just choose one of it