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_TopicIcon
trigger('reloadGrid') not updating data in grid
25/04/2012
23:16
Avatar
tm_scripter
Member
Members
Forum Posts: 3
Member Since:
25/04/2012
sp_UserOfflineSmall Offline

I have been having some success with jqgrid.  I am using version 4.3.2

I am able to create the grid in the document ready function and it works well, using:

$(document).ready(function(){

$("#resultsTable").jqGrid({

url:'mycontroller/myfunction',

mtype : "GET",

datatype: "json", 

 loadonce: true,         

......(more jqgrid definitions here).....

 });

 }); 

The problem I am encountering is refreshing/reloading the grid.

For example if I define a new array:

myDataR=   [                              

{Date:"2000-11-01",  CoName:"name1",  Type:"Re"},

{Date:"2000-11-01",  CoName:"name2", Type:"Le"},  

{Date:"2000-11-01",  CoName:"name3", Type:"Ce"},             

]

and try to populate the grid with the data using:

 $("#resultsTable").jqGrid('setGridParam',{data:mydataR}).trigger('reloadGrid');

nothing happens.Frown

I have also tried using: 

$("#resultsTable").jqGrid.addRowData("1", mydataR);

which also does not work.

Please help.

26/04/2012
01:47
Avatar
tm_scripter
Member
Members
Forum Posts: 3
Member Since:
25/04/2012
sp_UserOfflineSmall Offline

I was able to reload the grid successfully with trigger.('reloadGrid'), BUT only if I comment out the line:

loadonce=true,

I need the loadonce=true in order for the sorting and filtertoolbar to work....so how can I enable the grid to support both functionality?  ie, ability to reloadGrid AND sort locally.

26/04/2012
02:29
Avatar
tm_scripter
Member
Members
Forum Posts: 3
Member Since:
25/04/2012
sp_UserOfflineSmall Offline

SOLVED.

I can keep the loadonce=true, so sorting and filtertoolbar work.

The piece that was missing is to include datatype: "json" in the gridParam: 

$("#resultsTable").jqGrid('setGridParam',{url:"mycontroller/searchdata", datatype:"json", page:1}).trigger("reloadGrid");

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
161 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