使dojo grid属性query中的参数作为请求url的一部分
关键是要结合jsonrest实现
require([ "dojo/store/JsonRest","dojo/store/Memory","dojo/store/Cache","dojox/grid/DataGrid",//"dojox/grid/_CheckBoxSelector","dojo/data/ObjectStore","dojo/query","dojo/domReady!" ],function(JsonRest,Memory,Cache,DataGrid,ObjectStore,query){ var myStore,dataStore,grid; myStore = new Cache(JsonRest({target:"/dojo/getUsers"}),new Memory()); grid = new DataGrid({ store: dataStore = new ObjectStore({objectStore: myStore}),query: { id: "*" },structure: [ //{type:"dojox.grid._CheckBoxSelector"},{cells:[[ {name:"State Name",field:"name",width: "200px"},{name:"Abbreviation",field:"desc",width: "200px",editable: true} ]]} ] },"userList"); // make sure you have a target HTML element with this id grid.startup(); /* query("#save").on("click",function(){ dataStore.save(); }); */ });原文链接:https://www.f2er.com/dojo/291298.html