cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AClerk Established Member
Established Member

Auto Scrolling Table

Hey,

I started to explore custom visuals creation.

Is there a way to add an automatic scrolling to a table?
Pseudo:

While(TRUE)

   IF(Table has scrollbar > Start auto scroll down)

      IF(End of table > Start scroll up)

   Else(Do nothing)

 

Any ideas?

 

Ta!

 

 

13 REPLIES 13
v-evelk Established Member
Established Member

Re: Auto Scrolling Table

Hi,

 

We have implemented something similar for our Timeline Slicer visual.

If you use d3 selections, you can try to get HTML node from a selection and set scrolling properties as "scrollLeft" for instance.

 

You can find an example of the code here

https://github.com/Microsoft/powerbi-visuals-timeline/blob/master/src/visual.ts#L1527

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

AClerk Established Member
Established Member

Re: Auto Scrolling Table

Hi @v-evelk 
Thanks for the lead.

Any live demo of the project?
Thanks,

A

v-evelk Established Member
Established Member

Re: Auto Scrolling Table

Hi,

 

You can see how it works here.

Also you can download a standard Timeline Slicer report form the store.

Then you need to reduce visual size, select one of the last granulas and enable option "Scroll position auto adjustment" and save the report. After reload of the report you will see that horizontal scrolling position was shifted to the selected granulas.

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

AClerk Established Member
Established Member

Re: Auto Scrolling Table

Thank you @v-evelk 

That is nice, but not what I am after.

I want a table to scroll automatically, when the tab/page is opened. No human interaction what so ever.

Cheers!
A

v-evelk Established Member
Established Member

Re: Auto Scrolling Table

The example that I provided works exactly this way.

It automatically sets horizontal scrolling position to the selected granulas in timeline after timeline is rendered, there isn't any manual interactions except the moment when this feature must be enabled to make it working because this feature is optional.

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

AClerk Established Member
Established Member

Re: Auto Scrolling Table

Hi @v-evelk ,

The idea is to show the reports on a screen in the office. 

No one will have any interaction with the report.

 

So, if I have a table of 100 rows, I would like to show all records in a time period of 60 seconds, for instance.

I would like the table to scroll automaticcally, and show all the records.

This is an example of something that reminds of what I am after - https://stackblitz.com/github/NagRock/ngx-auto-scroll-example?file=src%2Fapp%2Fapp.component.ts

 

The moment the page loads, the div starts filling up with values.

But instead of a div, I want a Power BI table.

 

Thanks!

v-evelk Established Member
Established Member

Re: Auto Scrolling Table

Hi,

 

In fact, I don't see a problem. You can subscribe on an event if there is an event that happens after a row adding or anyway you can detect a moment when a row was added and then run the code that I provided.

Or if you want just to scroll down existing records you can use setTimeout or setInterval methods to scroll down step by step for every tick.

Also, there are a bunch of different libraries for changes detection and animation and now it is possible to use them if you use the beta version of PowerBI-visuals-tools that lets you to use WebPack for a package building.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

amjesquillo Frequent Visitor
Frequent Visitor

Re: Auto Scrolling Table

Hi @AClerk ,

 

Did you already found a solution to this?

AClerk Established Member
Established Member

Re: Auto Scrolling Table

@amjesquillo 
No.
I found workarounds instead.

I'll be happy to find a solution for my initial request.

Cheers!