这是我的代码:
<script>
require(["dojox/grid/DataGrid", "dojo/store/Memory","dojo/data/ObjectStore", "dojo/store/JsonRest", "dojo/_base/xhr", "dojo/domReady!"],
function(DataGrid, Memory, ObjectStore, JsonRest, xhr){
var gridSimple,
store,
dataStore;
function createGrid(){
gridSimple = new DataGrid({
store: dataStore,
structure: [
{ name: "Name", field: "name", width: "84px" },
{ name: "Last name", field: "lastName", width: "84px" },
{ name: "e-mail", field: "email", width: "120px" }
],
rowsPerPage: 20,
autoHeight:15,
selectionMode: "single"
}, "grid");
gridSimple.startup();
}
function init(){
store = new JsonRest({target: "/users/"});
dataStore = ObjectStore({objectStore: store});
createGrid();
}
init();
});
</script>
<div id="grid">
</div>
我正在获取第一页(正在发送 Range 标头),但是当向下滚动时没有任何反应,dojo 没有发送下一个请求。不知道我做错了什么。
我在 Firefox 14.0.1 上,顺便说一句,使用鼠标滚轮滚动真的很慢。我也试过 chrome,没有得到下一页,但至少鼠标滚轮工作得很好。
道场版本:1.7.2