Auto scrolling table

We would love to have a table on a dashboard that automatically and smoothly scrolls up and down.

I have a fiddle that accomplishes this, but I can't seem to get it to work within a dashboard.

Here is the JSFiddle link:

http://jsfiddle.net/0vphjq9u


Anyone have any ideas for how this could be acomplished with a script?

It is a bit complicated because a datagrid will not load more data than is displayed. This means that when you scroll down, it is also loading the data so it does not go smoothly or quickly.


I could not find a way to know when it's at the bottom but if you know your table size you could try something based on the following

var timer = setInterval(scrollTable, 400);
function scrollTable()
{
                if(//not at bottom and going down)
table1.control.scroll("down");
else //not at top and going up
table1.control.scroll("up");
}

You could recreate your fiddle and scroll to a particular offset using https://www.dundas.com/support/api-docs/js/#API%20Reference/dundas/controls/DataGrid/Methods/setScroll.html%3FTocPath%3DAPI%20Reference%7Cdundas%7Ccontrols%7CDataGrid%7CMethods%7C_____23

but I do not know how to calculate where your current scroll position is.



Thanks David, I appreciate the thoughtful response!


You basically concluded the same thing that the support staff concluded (after I had posted this yesterday).


Here is their response:


Unfortunately, currently it is not possible to implement auto scrolling like the one shown in your fiddle example.

The reason being that the tables in DBI are not simple structures like the one used in the fiddle example. The Dundas BI tables only have the restricted amount of data, the rows visible to the user, so we do not load more than what a user sees at that point in time for performance purposes.

Because, if we load the entire table at once then there is chance that the browser may crash because some of the tables may have millions of records.

Looking the entire table in cases where there are smaller number of records can be a valid feature request though. So, I will mark this issue as feature request where a user will be able to load the entire table at once and then will be able to apply smooth scroll or auto scroll like the one shown in your fiddle example. I have added you as the submitter of this feature request. Now, you will be able to check the status of this feature from your support account.

I would like to make a note that the feature requests are assessed and prioritized by our R&D team based on client demand and feasibility. This process may usually take time. I will update you with as soon as this request is implemented.

Yeah, I thought that might be the case.


If you really really wanted to do this, you could do it in the following manner.


1. Get the data, either via the API, or put a table off canvas at such a large height with a small font size so that it definitely will show (and therefore load) all the rows.


2. Write a script on data change of the table to loop through and get all the data out of the table and write html code to make a table including this data into the text of an html label component. Then scroll that using your fiddle.


As I said, only if you really really wanted to do it. It is a lot of work though...