following is the code for JavaScript Funcation that is , i am calling from my view using button onclick event
mygrid=new dhtmlXGridObject(v);
mygrid.setHeader("EMPID,ENAME,EPHNO,EEMAIL,EADDRESS,ESTATE,ECITY,EPIN ");
mygrid.setInitWidths(“50,100,100,50,100,100,50,100”);
mygrid.setColAlign(“left,left,left,left,left,left,left,left”);
mygrid.setColTypes(“ro,rotxt,rotxt,rotxt,rotxt,rotxt,rotxt,rotxt”);
mygrid.setColSorting(“na,str,str,na,str,str,na,str”);
mygrid.enableAutoWidth(true);
mygrid.enableAutoHeight(true);
mygrid.setPagingWTMode(true,true,true,[100,200]);
mygrid.setPagingSkin(“toolbar”,“dhx_web”);
mygrid.setSkin(“dhx_web”);
mygrid.init();
mygrid.load(“view.htm?cmdAction=displayEmp”,“json”);
and following is the code of the Controller Method:
public ModelAndView displayEmp(HttpServletRequest request, HttpServletResponse response, EmployeeFormBean bean) throws Exception
{
ModelAndView mv = new ModelAndView();
try
{
System.out.println(“in display emp”);
mv.addObject(“json”, empservice.displayEmp());
mv.setViewName(“index”);
}
catch (Exception e)
{
e.printStackTrace();
}
return mv;
}
Where empservice.displayEmp() return me data in the following format(sample data):
{rows: [{“id”:“1”,“data”:[“1”,“test”,“9898989898”,“test@test.com”,“test data”,“Gujarat”,“Surat”,“395004”]},{“id”:“2”,“data”:[“2”,“TEST Data",“9898989898”,"test@test1.com”,“TEst Data”,“Gujarat”,“Surat”,“395004”]},{“id”:“3”,“data”:[“3”,“TEST Entry",“9898989898”,"test@gmail.com”,“cfvdfgdf”,“mp”,“indore”,“395004”]}]}
I am doing this on Spring Framework.
I test all the thing as i can,the problem is that the header is only display without data in dhtmlx grid…
kindly give me any suggestion to solve this problem…