views:

229

answers:

0

I recently set up a dojox.data.CouchDBRestStore in combination with a dojox.grid.DataGrid. Initially the data get displayed as they should. But if you scroll down the grid no new values get retrieved from the couchdb. Adding a row index to the store shows that the grid is aware of the total count of the documents within the database as the row index is equal to the number of documents within the database.

Watching the HTTP traffic tells that the correct HTTP requests are getting sent on scrolling the grid - including correct response data from the server. But these data are not getting fed to the grid. It keeps showing the first 25 rows and three points for every value in the subsequent rows.

Is it possible that the "offset" attribute of the returned JSON object is not getting interpreted correctly by dojo?

Here are the code fragments i use (dojo versions: 1.4 and 1.4.1):

var myStore = new dojox.data.CouchDBRestStore({target:"http://url.to.server:5984/database/", idAttribute: "_id", labelAttribute: "myLabel"});

var layout= [
  new dojox.grid.cells.RowIndex({ name: "row #", width: '15%', styles: "text-align: right;" }),
  {
   field: '_id',
   name:'id',
   width:'10%'
  },{
   field: 'myLabel',
   name:'Name',
   width:'90%'
  }  
  ];

var myGrid = new dojox.grid.DataGrid({
      id: 'myGridId',
   store: myStore,
   scrollRedrawThreshold: 1,
   rowsPerPage: 25,
                    rowSelector: '0px',
   height: '100%',
   width:'100%',
                    structure: layout
     },
document.createElement('div'));