加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 21:32:10 所属栏目:百科 来源:网络整理
导读:使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","doj

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读