当前位置 : 主页 > 网页制作 > Dojo >

使dojo grid属性query中的参数作为请求url的一部分

来源:互联网 收集:自由互联 发布时间:2021-06-15
使dojo grid属性query中的参数作为请求url的一部分 关键是要结合jsonrest实现 require(["dojo/store/JsonRest","dojo/store/Memory","dojo/store/Cache","dojox/grid/DataGrid",//"dojox/grid/_CheckBoxSelector","dojo/data/ObjectSt

使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();
	}); */
});
网友评论