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

前端之家收集整理的这篇文章主要介绍了使dojo grid属性query中的参数作为请求url的一部分前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使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();
	}); */
});

猜你在找的Dojo相关文章