Issue with resetting custom Detail grid jqgrid postData params after reloadGrid

QuestionsIssue with resetting custom Detail grid jqgrid postData params after reloadGrid
Steve Borruso asked 5 years ago

Hi Abu,

I have a Master grid containing user name rows

When I click on a user name the Detail grid is updated with the user’s data

On the Detail grid I have custom controls that will add 2 jqgrid postData params and reload the detail grid

This all works fine.

The problem is if I then choose a diff user in the Master Grid, these two custom parameters are still active and included in the url that loads the Detail grid for the new user.

I’ve tried nulling out those 2 postData parms and deleting them after a custom control is executed but the parm values still seem to be included. Here’s an example of one of the custom controls when it does a reload with the 2 parms –

$(“#<?php echo $g3->id ?>”)
.setGridParam({
postData: {
year : view_year,
month : view_month
}
})
.trigger(“reloadGrid”);

// NOTE – Now we need to null out the 2 postData parms to prevent these from being included when a new user is selected in the Master grid
var mypostData = $(“#<?php echo $g3->id ?>”).jqGrid(“getGridParam”, “postData”);
myPostData.year = ”;
myPostData.month = ”;

The reloadGrid works fine but if I then click a new user in the Master grid the url back to the sever contains the old month and year values from the previous user.

Any help in sorting this our is most appreciated,

Thanks,

Steve

1 Answers
steve orruso answered 5 years ago

Found the problem … typo … duh …

var mypostData = $(“#<?php echo $g3->id ?>”).jqGrid(“getGridParam”, “postData”);
myPostData.year = ”;
myPostData.month = ”;

“mypostData” -vs- “myPostData”

Pays to look at the browser debug console  as opposed to the Network traffic all the time.

Once I fixed that, all seems to work now as intended.

Your Answer

16 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?