DataTable autoscroll

Hello,
My name is Tudorel and I use very little time webix.
I have a html page with a html table that makes auto scroll with the code below.

function pageScroll() {
    window.scrollBy(0, 1);
    scrolldelay = setTimeout(pageScroll, 30);
 }
 
 body onLoad="pageScroll();"

 //here is html table

 //here is webix datatable

When I replaced html table with webix datatable, the code I have no longer works.
You know how I could do to get the same effect with datatable.
Thanks!

Hi,

You can set the automatic scrolling with the Webix method scrollTo:

http://webix.com/snippet/86093ec4

Thank you! I’ll try that.

It works very well, but I have one more question. It is possible to know when it has completed scrolling because I want to reload the page exactly when scrollDown function is finished?
Thank you!

You can use onAfterScroll event:

http://webix.com/snippet/4d037735

With your example I can’t calculate(predict) the exact value (will be) of last scroll position, to be able to reload the page immediately after it has finished scrolling.
I gotta calculate before the scroll get into position, in order to be able to compare with the real value and trigger reload.
Thank you!

As you know the initial value (0 on init, or you can use getScrollState() at any moment) and set your own scroll step, the last scroll position can be easily calculated.

http://webix.com/snippet/e7e888e5

Thank you, very much! It works!
I didn’t know what it represents the ind parameter.
I finally found it is in fact the index of datatable rows.

In this particular case - yes, but actually it’s a value of i for the current iteration.