dojo - OnDemandGrid (Dgrid) won't fire a request -


when scrolling grid, not fire new request more items when reach end of 20 items

i using dojo version 1.10.4. created trackablerest store

    var trackablerest = declare([rest, trackable]);     var interceptstore = new trackablerest({         target: 'rest/intercepts/',          accepts: "application/json",         sortparam: 'sort',                  rangestartparam: 'offset',         rangecountparam: 'limit',         headers:{             'accept': "application/json",             'content-type':"application/json",             'charset':"utf-8"                      },         idproperty: 'id'     }); 

then created grid:

var grid = window.grid = new customgrid({     id: 'grid',     //sort: [{property:'elnot'},{property:'rf_avg'}], // initialize sort on last name, ascending     collection: interceptsstore,     sort: "id",     getbeforeput: false,     columns: getcolumns(),     allowselectall: true,     loadingmessage: 'loading data...',     nodatamessage: 'no results found.',     title: "all",     minrowsperpage: 20,     maxrowsperpage: 250 }); 

the request sent http://localhost:8080/olympiamap/rest/intercepts/?sort=+id&offset=0&limit=20

and response includes header content-range value of items=0-20/606 , data looks enter image description here

so after 2 days of waiting realized though return content header in desired format appears using values in response total, limit , offset (or whatever choose start , count params). instance, in response headers returned content-range value of "items 0-20/606" in actual response have items array 20 items , total of 20. when hard coded valued (just test) match 606 value started see virtual scrolling work , send request incrementing start , count. 1st on page load http://localhost:8080/olympiamap/rest/intercepts/?sort=+id&offset=0&limit=20

while scrolling http://localhost:8080/olympiamap/rest/intercepts/?sort=+id&offset=20&limit=20

etc , on

this due lack of documentation on part of dstore , dgrid


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -