Jqgrid 动态加载select editoptions数据

1、前端代码colModel代码:

	{name:'org.name',index:'org.name',width:90,sortable:true, editable:true,edittype:"select",editoptions:{value:getOptionValue()}},

getOptionsValue()函数方法:

 function getOptionValue() {
 	var options = "";
 	var i = 0;
 	$.ajax({
 		async: false,  //千万要记住加这个属性配置
 		type: "post",
 		url: "http://localhost/GW/jcxxAction!org_index.action",
 		success: function(data) {
 			for(i; i < data.length; i++) {
 				if(i != data.length - 1) {
 					options += data[i].jlbh + ":" + data[i].name + ";";
 				} else {
 					options += data[i].jlbh + ":" + data[i].name;
 				}
 			}
 		}
 	});
 	return options;
 }

2、服务端action代码:

public String org_index(){
		parentId = parentId;
		orgList = orgManager.findOrgs(parentId);
		return "org_index";
	}

strust.xml配置

orgList



你可能感兴趣的:(jqgrid)