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 6561045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:32:21+00:00 2026-05-25T13:32:21+00:00

My data is being correctly loaded on my page. However I have 2 textboxes

  • 0

My data is being correctly loaded on my page. However I have 2 textboxes and one submit button based on which I want to filter the records from the server.

Note: I am not using existing filters functionality that is available with jqgrid by default.

I am little confused how can I achieve this. Is there any built in capability of jqgrid to achieve this? The way I currently handle this is I handle the click event in my javascript and supply post data to the action method:

  $('#submit').click(function () {

            $("#customers").jqGrid('setGridParam', { postData: { 'ContactName': $('#contactName').val(),
                CompanyName: $('#companyName').val()
            }
            });

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

        });

This post data is then being captured on action method and it works fine. Is there any better way of doing this? or am I on right track? Sometimes I feel I write less code on the server and have become more of a client side programmer since I started using Asp.Net MVC 3.0 😉

  • 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-25T13:32:22+00:00Added an answer on May 25, 2026 at 1:32 pm

    You don’t have to use setGridParam to change postData as you can declare a function :

    jqGrid({
        url : ...,
        datatype : ...,
        mtype : "POST",
        postData : { 
                "ContactName" : (function() {
                                return $("#contactName").val();
                            })
        }
    }
    

    so your submit function will only call to reloadGrid

     $('#submit').click(function () {
        $("#customers").trigger("reloadGrid");
     }
    

    If you want to reduce the amount of code, and you’d better create a simple API in JS to select entities like Customer, Person, Contact etc. Currently I have an app which forms consist of dozens such entities – so I had to create an JS API for selecting(it also gives universal look and feel). From the client side the customer specifies the name of list to get, while the list of possible names is defined in the server’s configuration file, which also defines the query to the ORM and how to display fields(I am using an expression language to map from entity fields to strings).

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

Sidebar

Related Questions

I have a question regarding the some data which is being transfered from one
I am working on a content management application in which the data being stored
I want to get at the item that is being data bound, during the
I'm working on creating a grouped table view. The data is being loaded alright,
I have table rows of data in html being filled from a CGI application.
We use ViewState to store data that is being edited by users. However, ViewState
I've got a whole bunch of data being displayed in different Labels, now I'm
I'm working on an asp.net-mvc application. The linq data context is being passed into
I'm being given a data source weekly that I'm going to parse and put
After being stumped by an earlier quesiton: SO google-analytics-domain-data-without-filtering I've been experimenting with a

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.