hashmap 유형의 데이터를 jqgrid로 리턴하는 컨트롤러에서 데이터를 가져 오는 방법을 알려줄 사람이 있습니까?jqgrid를 사용하여 표 형식으로 데이터를 표시하십시오.
이것은 내가 시도한 것입니다. 그것의 무한 베다에 입력
$(document).ready(function(){
$("#datatable").jqGrid({
url:"${pageContext.request.contextPath}/employees",
cache: false,
colNames:["id","name","age","salary","address","laptop"],
colModel:[
{name:"id",index:"id", width:60},
{name:"name",index:"name", width:90},
{name:"age",index:"age", width:100},
{name:"salary",index:"salary", width:80, align:"right"},
{name:"address",index:"address", width:80,
align:"right"},
{name:"laptop",index:"laptop", width:80,align:"right"}
],
mtype: "GET",
rownumbers: true,
rownumWidth: 40,
gridview: true,
caption: "Hashmap Data"
});
});
컨트롤러 부
@RequestMapping(value="/employees", method = RequestMethod.GET)
public ModelAndView listEmployees() {
Map<String, Object> model = new HashMap<String, Object>();
model.put("employees",
prepareListofBean(employeeService.listEmployeess()));
for (Entry<String, Object> entry : model.entrySet()) {
String key = entry.getKey().toString();
Object value = entry.getValue();
System.out.println("hello key, " + key + " value " + value);
}
return new ModelAndView("employeesList", model);
}
예 : 직원 값 [1 램 (22) 12234 미국 네, 6 ABC 25 23889 XYZ, 예]
하십시오 누군가의 도움 이 문제를 해결하기 위해 나. 의 구문 분석 오류를 제공합니다 : 당신의 URL ${pageContext.request.contextPath}/employees
수익을 무엇 잘못된 XML 메시지
로 변경하는 것은 우리에게 그 AJAX 호출의 예를 들어 데이터를 표시하십시오보십시오. – juzraai
값 [1 ram 22 12234 usa 예, 6 abc 25 23889 xyz, 예] – abc