Current position view

Hello,

on dhtmlx.com/docs/products/dht … 50000.html there is an example with smartrendering.
Is it possible to show in footer the current position view like
“You see lines x …y”
while scrolling in grid?

Regards, Carsten

Yep, you can use something like next

grid.attachEvent("onScroll", function(){ var state = this.getStateOfView(); var pos = "You see lines "+state[0]+"..."+(state[1] + state[0]); document.getElementById("some").innerHTML = pos; });

Thanks, it works, but i miss an offset of 1. state[0] starts with 0.

Sorry, again.
Are you really sure it works correct?
On my page (i use smartrendering in grid) i get 773 records from the db and if i scroll down to the bottom of grid first time i get “765…778”. After this i scroll up and down now i get “767…780”, at third time i get “772…785” and so on. And the size of view is every time the same.

By any chance, are you using multiline mode in grid ?
Above logic will work only for fixed line-height.

Yes, because:
viewtopic.php?f=2&t=25563
entry #4

In case of multiline mode the result of getStateOfView will not be correct for multiline mode.
You can open ticket at support system, and we will provide a patched version, which will have such ability in multiline mode ( solution is a little performance expensive - but possible )