Scrollable table in DV-TV

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Scrollable table in DV-TV

Post by rpierce » 2022-03-24 15:51

Hi,

I have found code in the forum to make the table header sticky while scrolling through the records in table view. Is there a way to make the header sticky while in DV-TV?

Thank you,
Ray
Capture.JPG
Capture.JPG (82.79 KiB) Viewed 1575 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Scrollable table in DV-TV

Post by pbottcher » 2022-03-24 21:25

Probaly the same code shall work also for the DV-TV, but you need to wait till the child-table is loaded before applying the change.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Scrollable table in DV-TV

Post by rpierce » 2022-03-25 03:45

The code is in the footer-extras hook file. It does change the header color in DV-TV but doesn't make the header sticky.

I don't understand your meaning, "wait until the child-table is loaded before applying the change".

Thank you,
Ray

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Scrollable table in DV-TV

Post by pbottcher » 2022-03-25 06:50

The code in footer-extras is executed before the child table is loaded. This is due to the fact, that the child table is loaded asyn. So that means, that before executing the code to the change of the table, you need to make sure that the child table is loaded.

The color changes as this happens through the CSS definitions which is also applied for elements loaded later.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Scrollable table in DV-TV

Post by rpierce » 2022-03-25 20:13

Hello again,

That makes sense, but how do I go about doing it? I have the record in DV-TV, so aren't both tables open? The code affects the header color of the child table but doesn't make it sticky.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Scrollable table in DV-TV

Post by pbottcher » 2022-03-27 16:05

Hi,

well as a quick try, wrap the code in a setTimeout(function, milliseconds);

Code: Select all

setTimeout(function () {
  CODE FOR STICKY TABLE
}, 1000);
Adjust the 1000 to your needs.

WARNING, this is just a quick fix to test if it works.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Scrollable table in DV-TV

Post by rpierce » 2022-03-28 03:51

YES. That worked! What is the permanent fix?

rpierce
Veteran Member
Posts: 258
Joined: 2018-11-26 13:55
Location: Washington State

Re: Scrollable table in DV-TV

Post by rpierce » 2022-03-30 01:46

One thing I noticed however is that in a table that does not have a child table being shown below it (no DV-TV), the formatting of the table is ruined. If I remove the timer code, the formatting is restored.

Post Reply