I have the following example:
var url = '@Url.Action("GetProgData", "Prog")' + '?lbId=' + labId;
$("#loginList").jqGrid({
url: url,
datatype: "json",
colNames: ['PNum', 'Client', 'Salesperson', 'Email'],
colModel: [ ...
......
The method looks like the following in c# MVC:
public JsonResult GetLoginData(int rows, int page, string sidx, string sord, string searchField, string searchString, string searchOper, int? labId)
What I like to do is to pass the value of labId conditionally so I have the following but doesn’t seem to pass labId as it return null:
$("#LabId").change(function () {
labId = $("#LabId").val();
setupGrid(labId);
$("#loginList").trigger("reloadGrid", [{ page: 1}]);
});
Not sure when I do it in the .change of a dropdown the value of labID does’t go through fine
I think that you can sent
nullas the value oflabIdifIf the above solution will not work, than you can do the following alternatively