Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Can not display the result in grid...
17/12/2013
15:17
Avatar
pj.pavanjayam@gmail.com
Hyderabad
New Member
Members
Forum Posts: 2
Member Since:
17/12/2013
sp_UserOfflineSmall Offline

Hi, The below is the jqgrid code.

I  am able to pass the request to spriong mvc controller.

But I am unable to view the data in jqgrid.

Plese find the mistake in it. It eating hours of timeCry.

-----------------------------------------------------------------------------

var urlRequest = "emp.html";

$("#projectTable").jqGrid('setGridParam',{url:urlRequest,datatype: 'json', page:1}).trigger("reloadGrid");

$("#projectTable").jqGrid({

url: urlRequest,

datatype: 'json',

 mtype: 'POST',

colNames:['First Name','Last Name', 'Address'],

 colModel:[

{name:'firstName',index:'firstName', width:100,sortable:true},

{name:'lastName',index:'lastName', width:100,sortable:true},

{name:'address',index:'address', width:500,sortable:true}

  ],

           jsonReader : {

       repeatitems: false ,

 records: "records",      

 total: "total",      

  page: "page",

root: "rows"

},

 rowNum:5,

  sortname: 'firstName',           

viewrecords: true,           

pager: "#pagingDiv",           

height:'auto',rowList:[5,10],

 loadonce: true 

});

------------------------------------------------------------

Controller code:

--------------------------------------

@RequestMapping(value="/emp", method = RequestMethod.POST)

@ResponseBody

 public JqGridData<Person> getPeople(){

 List<Person> personList = new ArrayList<Person>();

    personList.add(new Person("Sue", "Green", "207 Old Stree, Clevedon"));   

personList.add(new Person("Jane", "Adams", "216 Park Road, Clevedon")); 

  personList.add(new Person("David", "Smith", "185 Old Kent Road, Clevedon"));

personList.add(new Person("Adam", "Davies", "18 Knowles Road Clevedon"));

    int totalNumberOfRecords = 4;

int pageNumber = 1;

int numberOfRows = personList.size();

    JqGridData<Person> gridData = new JqGridData<Person>(numberOfRows, pageNumber, totalNumberOfRecords, personList);

  return gridData; 

}

--------------------------------------

Thanks,

Pavan Jayam

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
36 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information