0

I've been using dgrid's OnDemandGrid with dojo.store.JsonRest rather successfully after a bumpy start, but while implementing caching noticed a glitch: if I do a long swipe of my trackpad (i.e. I scroll rather unscientifically a "long way") and then scroll back, dgrid seems to become confused about where I am at. For example, say I am near row 1609 and then swipe down and find myself looking at row 500. If I then scroll back up towards the top, I'll find the id's of the rows may look something like this 1609, 1608, 1607, 503, 502, 501, 500... If I scroll downward father, it will pick up with the missing rows 499, 498, 497, 1606, 1605, etc.

var store = Observable(Cache(JsonRest({
    target: "/cgi-bin/safari/safari_retrv.pl?action=front&format=json",
    sortParam: "sort",
    idProperty: "queryId"
}),Memory()));


var grid = new declare([OnDemandGrid, Keyboard, Selection, DijitRegistry])({
    store: store,
    query: {aid: "1604" },
    bufferRows: 40,
    loadingMessage: "Loading...",
    columns: {
        aid: "AID",
        title: "Title",
        poster: "Poster",
        postTime: "Posting Date",
        commentCount: "Comments"
    },
}, "grid");

The problem occurs even if the store is just JsonRest without the Cache store.

Timothy R. Butler
  • 1,097
  • 7
  • 20
  • Strange, I can't reproduce that with my Grids (granted, I'm unable to test with an actual touch device). If you look at the requests being sent to the server, and the Range and Content-Range headers (for the request and response, respectively), do they look "out of order" too? That would indicate whether the issue is with the rows being inserted in the DOM incorrectly, or if the offset is being mangled in the scroll event. – Frode Dec 09 '12 at 16:13
  • Sorry @Frode somehow I missed your question. I wasn't able to spot anything unusual in the queries and I can't quite put my finger on what causes it to happen. I think it only occurs if I scroll far enough that some of the past rows have been removed from cache (perhaps it forgets where it is?). All of the data appears to be there, it just isn't displayed in the right order. – Timothy R. Butler Jan 03 '13 at 04:08

0 Answers0