However, whenever loadnext() is called, the grid is returned to the top. Is this working as intended or is this a bug? If it’s intended, is there a method to adjust the view to a certain location in the grid? Thanks,
Yes this problem is in the current version and I would also like a resolution for this.
I am using a bit of a kludge at the moment to return the view to the position when the data-load was triggered. This is only just passable as the grid scrolls to the top before scrolling to the final position.
// triggered by onAfterLoad
$$(_a.NAME + '_grid').scrollTo( _a.scrollState.x, _a.scrollState.y );
Yes, I am using the latest version I believe. I downloaded the lib.zip package posted at the end of the thread which I referenced and the bug is still there.
After scrolling to the last loaded item, the next portion of data is shown. For example, when you scroll to the “Book 19” item, the grid loads next items and shows data from “Book 20” to “Book 27”. How can we reproduce the different behaviour ?
I use the exact same call as you did and the latest libraries, and whenever new data is loaded into the grid, the grid scrolls back up to the top. This means the user has to keep scrolling down to get back to where they were every time new data is loaded.
$$('Client_Grid').attachEvent('onAfterScroll', function(pos) {
var count = (Math.abs(pos.f)+this.$view.offsetHeight)/43;
if((count+0.1)>=this.dataCount())
this.loadNext(20);
});
Even some way to scroll to a specific position would be a fantastic work around for now, because then I can scroll back to their position prior to dynamic loading after the dynamic loading occurs.
The demo works exactly like what I’m looking for. In fact, my loadNext(20) call is the exact same as yours and I replaced my touchui.js and touchui.css files with yours, and it still shows the top of the list.
I have not done much PHP programming, but from what I can tell, your JSON creates and returns only 20 items at a time. So it’s displaying the very first item every time which your data source returns.
My data source returns the top 20, then top 40, then top 60, which is why it’s always returning to the top - the item at the top of my data is the same every time. Rather, it should be returning the first 20, then the next 20, then the next 20 as yours does.
So I believe this issue is working with the supplied files - I just need to correct my code. Thank you!