드롭다운 상자의 - 동적 데이터 가져오기

3148 단어 jsonext
adduser.securityDegree1=null;
adduser.securityDegree = new Ext.form.ComboBox( {
		store : new Ext.data.Store( {
			proxy : new Ext.data.HttpProxy( {
				url : '../JSON/groups_GroupsRemote.getSecurityDegree'
			}),
			reader : new Ext.data.JsonReader( {
				totalProperty : 'totalProperty',
				root : 'root'
			}, [ {
				name : 'id'
			}, {
				name : 'name'
			} ])
		}),
		fieldLabel : "  "',
		hiddenName : 'securityDegree',
		valueField : "id",
		displayField : "name",
		mode : 'remote',
		allowBlank : true,
		disabled : false,
		forceSelection : true,
		editable : false,
		triggerAction : 'all',
		emptyText :      *...,
		labelStyle : 'padding:5px 0px 5px 0px',
		listeners : {
			select : function(combo, record, index) {
				adduser.securityDegree1 = record.get('id');
			},
			beforequery : function(qe) {
				delete qe.combo.lastQuery;
			}
		},
		style : 'margin-bottom: 5px;',
		width : 175
	});

   JSONArray JSONObject    :
JSONObject obj = null;
JSONArray ary = new JSONArray();

for(Grops g:list){
   obj = new JSONObject();
   obj.put("id",g.getItemID());
   obj.put("name",g.getItemName());
   ary.add(obj);
}

obj = new JSONObject();
obj.put(”totalProperty",ary.size());
obj.put("root",ary);
return obj.toString();




obj.put("tatalProperty",ary.size());
obj.put("root",ary);















{
					xtype : 'combo',
					anchor : "90%",
					store : new Ext.data.Store({

						proxy : new Ext.data.HttpProxy({
							url : '../JSON/maintenance_deptype_deptypeService.getDeptypeName'
						}),
						reader : new Ext.data.JsonReader({
									totalProperty : 'totalProperty',
									root : 'results'
								}, [{
											name : 'typename'
										}, {
											name : 'deptypeid'
										}]),
						baseParams : {
							deptypeid : kind
						}
					}),
					valueField : "deptypeid",
					displayField : "typename",
					mode : 'remote',
					forceSelection : true,
					hiddenName : 'kind',
					editable : false,
					triggerAction : 'all',
					fieldLabel : '' + getResource('resourceParam686') + '',
					blankText : '' + getResource('resourceParam683') + '',
					name : 'kind',
					emptyText : '' + getResource('resourceParam684') + '',
					allowBlank : false
				}





좋은 웹페이지 즐겨찾기