当滚动发车,它不会激发更多的项目一个新的请求。我创建了一个TrackableRest商店OnDemandGrid(Dgrid)将不会触发请求
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'
});
然后创建了一个网格:
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
});
请求被发送 http://localhost:8080/OlympiaMap/rest/intercepts/?sort=+id&offset=0&limit=20
而所述响应包括所述报头的Content-范围与项目值= 0-20/606 且数据看起来像 enter image description here
的插件做你用来创建'CustomGrid'? –
var CustomGrid = declare([OnDemandGrid,Selection,DijitRegistry,Selector,Keyboard,Editor,ColumnHider,ColumnResizer,ColumnReorder]); –