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

  • Home
  • SEARCH
  • 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 5968413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:05:11+00:00 2026-05-22T20:05:11+00:00

I generate my jqgrid from model class which I pass into view. I get

  • 0

I generate my jqgrid from model class which I pass into view. I get constructed and working jqgrid. However, I want to set postData on one view, where I use jqGrid, from script in that view, after I call helper for creating jqgrid, without having to change whole partial view which creates jqgrid.

I tried running

$("#@Model.Id").jqGrid('setGridParam', { postData: { test: 233} });

and

$("#@Model.Id").setGridParam({ postData: { test: 233} });

but without error or any result. If I set postData in jqgrid parameters (in partial view where it is constructed, it works.

I also checked that grid exists, added

console.log($("#@Model.Id").size());

before the first line, and it shows 1.

UPDATE: This .setGirdParam function started to work for me for no apparent reason, so I will accept answer if someone can give some insight what can prevent this from working.
Thanks

  • 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-05-22T20:05:12+00:00Added an answer on May 22, 2026 at 8:05 pm

    You didn’t include the definition of jqGrid in your question and we can’t see the place where the setGridParam is called. First of all you should use setGridParam after the jqGrid is created, but before the request will be sent. If you will change the postData the next jqGrid request can use the new parameter. So one typically uses

    $("#@Model.Id").trigger('reloadGrid', [{page:1}]);
    

    see here.

    I suppose that the best option for you will be the usage of function test property of the postData as the function:

    $("#@Model.Id").jqGrid({
        // ... other jqGrid parameters ...
        postData: {
            test: function() {
                // the code can by dynamic, read contain of some elements 
                // on the page use "if"s and so on and return the value which 
                // should be posted to the server
                return 233;
            }
        }
        // other jqGrid parameters ...
    });
    

    See here for details. In this way you can implement practically any scenario.

    By the way if you don’t want that jqGrid to send any request to the server till the event is happened you can use datatype:'local' at the initialization time. Then if you want that the grid should be filled you can use setGridParam to change the datatype from 'local' to 'json' (or 'xml') and call .trigger('reloadGrid',...).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

rails generate model User email:string password:string creates the following migration script class CreateUsers <
By generate, I mean auto-generation of the code necessary for a particular selected (set
I generate all my columns in a subclassed DataGridView programmatically. However Visual Studio 2008
I generate a figure in MATLAB with large amount of elements (100000+) and want
I'm using the jQuery plugin that generates interactive tables called jqGrid . I want
I generate a pdf file from HTML using Pisa: def fetch_resources(uri, rel): path =
I generate graphml file from my application writing in Delphi7. Every thing is fine
I generate Java classes from my XSD schema file using XJC command line tool.
I generate a file server side and I want the client to automatically open
I'm trying to load data from the jsp response which is a JSON using

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.