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
After upgrading to 3.5.3 from 3.4.2 reload stops working
11/09/2009
11:16
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

After upgrading to 3.5.3 from 3.4.2 $("#gridName").trigger("reloadGrid") stopped working from the function called on LoadComplete but $("#gridName").trigger("reloadGrid") works from a button on the page once the grid is loaded. 

The grid is loaded via json fed from a url. The server gets the initial request on load but never gets the second reload fired on loadComplete. 

    $("#gridName").jqGrid({

        url: 'WSGridGetJson.aspx',

        datatype: "json", 

        mtype: 'POST', ..........

I've traced the process to grid.base.js line 588

populate = function () {

     if(!ts.grid.hDiv.loading) { ...

It appears that populate will only happen if the grid is not loading and I assume that loadComplete is part of the loading process. This must have been different in version 3.4.2. 

Can I clear the loading flag from on loadComplete process. If so, how and what might be the reprecussions of such a change is standard process? Can PostData be set before the grid is created in verison 3.5.3. ( I believe this method of shaping grid data was devised back in version 3.1, perhaps the process has changed since then)

The grid is reloaded on loadComplete to set PostData to variables acquired after the page containing the grid is created to control the loaded data set. 

Called from on loadComplete function.

        $("#gridName").setPostData({ un: "x", ci: "y", pll: "z" });

        $("#gridName").trigger("reloadGrid");

11/09/2009
12:09
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

The answer to my question is:

there is an event that runs before the first request. It is named appropriately enough, beforeRequest:

I called appendPostData in that event process to add the required variables. 

$(”#gridName”).appendPostData({ un: “x”, ci: “y”, pll: “z” });

This is a much more efficient way of controlling the dataset on first load. 

I found its definition in the jqGrid Wiki event section. The wiki is not complete yet but seems to include newly added functionality. 

Thank you Tony for adding this event.

11/09/2009
12:44
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Rob,

You can simple (as described in grid options) whitout using any event

jQuery("#mygrid").jqGrid({

...

postData: { un: “x”, ci: “y”, pll: “z” },

...

});

This will apend the items to postdata array

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

12/09/2009
07:43
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

Even better, thanks Tony.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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