onAfterScroll with loadNext

I have a scenario where the dataview can be loaded page by page, so I am trying to use onAfterScroll method and find out the position, but I am getting undefined as a result. Please help.
I can’t use the dynamic loading, as the URL is external and not from my server. The external URL supports only 20 items per request and the respective request can be accessed only by giving page number. In this scenario I have to use only loadNext with onAfterScroll right?

Any help?

Example is here: http://webix.com/snippet/b7e88a05

onAfterScroll doesn’t take any parameters (there’s an inaccuracy in Docs, sorry).

getScrollState within the onAfterSctroll will return the needed position, but the data will be loaded every time when scroll gets the predefined position (range):

http://webix.com/snippet/cc1a34d1

I suggest you check the following article, as it is possible to use a custom proxy for the data loading:

http://webix.com/blog/dynamic-loading-fetching-unlimited-number-of-records-from-server-side/#more-8762

Thank you. Regarding the custom proxy, the URL supports http?

Yep, it will work with any URL.

It is not working, what am I missing? http://webix.com/snippet/36256d31

You define the proxy after using it in the ui definition.

Also clicking on the button crashes due to the non-existant variable ‘movies’, but I guess it’s not the point of the example.