Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:28:32+00:00 2026-06-17T09:28:32+00:00

I have the following example: var url = ‘@Url.Action(GetProgData, Prog)’ + ‘?lbId=’ + labId;

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:28:33+00:00Added an answer on June 17, 2026 at 9:28 am

    I think that you can sent null as the value of labId if

    $("#loginList").jqGrid({
        url: '@Url.Action("GetProgData", "Prog")',
        postData: {
            lId: function () {
                var labId = $("#LabId").val();
                return labId === "" ? null : labId;
            }
        },
        datatype: "json",
        colNames: ['PNum', 'Client', 'Salesperson', 'Email',
        ...
    });
    

    If the above solution will not work, than you can do the following alternatively

    $("#loginList").jqGrid({
        url: '@Url.Action("GetProgData", "Prog")',
        serializeGridData: function (data) {
            var labId = $("#LabId").val();
            return labId === "" ? data : $.extend(true, {}, data, {lId: labId});
        },
        datatype: "json",
        colNames: ['PNum', 'Client', 'Salesperson', 'Email',
        ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

everyone. I have following example script: <script type=text/javascript> $(document).ready(function() { var url = http://api.twitter.com/1/statuses/user_timeline/codinghorror.json;
I have following code: var params = { cache:false, dataType:json, type:GET, url: /order.php, error:
I have the following array as3 example: var arrayDefinitionsargsAmfPhp:Array = new Array(); arrayDefinitionsargsAmfPhp['tabela'] =
We have the following example in node.js var http = require('http'); http.createServer(function(request, response) {
I have taken the following object as an example: var questions = { 1:
For example suppose I have the following app.get('/', function(req, res) { var ip; if(req.headers['x-forwarded-for']){
UPDATE : I have the following code: <script type=text/javascript> function addScript(url) { var script
For example, I have the following string: var string = 'watch this video http://vimeo.com/8122132
in socket.io 0.6, i have following example code: var io = require('/usr/lib/node_modules/socket.io'); var server
I have the following code: var c = null; c = Titanium.Network.createHTTPClient(); var url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.