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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:11:30+00:00 2026-06-17T14:11:30+00:00

I am Using JQGrid to display some list of data from db depending on

  • 0

I am Using JQGrid to display some list of data from db depending on LogID selected from drop down list.
ITS displaying contents Correctly on first click.
But on all subsequent click nothing happens the page doesn’t change or reload or do any thing, but if I try to debug the script I can see that the button click event is fired every time its clicked but still it doesn’t bring back the changed LogID data from the db. I am not sure but I think its something related to the reloadGrid trigger …

  <script type="text/javascript">
    var firstClick = true;
    $(document).ready(function () {
        $('.editor-date > input').datepicker();
        $('.getdata').click(function () {
            if (!firstClick) {
                $("#GridTable").trigger("reloadGrid");
            }
                firstClick = false;
                $('#GridTable').jqGrid({
                    url: '<%= Url.Action("GetData", "Report") %>',
                    datatype: 'json',
                    mtype: 'POST',
                    colNames: ['Log ID'],
                    colModel: [{ name: 'LogID', index: 'MessageLogID', key: true, formatter: pointercursor }],
                    multiselect: true,
                    sortname: 'LogID',
                    sortorder: "asc",
                    viewrecords: true,
                    pager: $('#pager'),
                    rowNum: 20,
                    rowList: [5, 10, 20, 50],
                    postData: {
                        IdParam: $('#testLogID').val()
                    },
                    jsonReader: {
                        repeatitems: false,
                        id: 'LogID',
                        records: 'TotalRecords',
                        total: 'TotalPages',
                        page: 'CurrentPage',
                        root: 'Rows'
                    },
                    loadError: function (xhr, status, error) {
                        messageBox('Error', 'Error occurred loading data.');
                    },
                    height: 'auto',
                    width: 'auto'
                });

            });

I found a similar issue but the solution is not workingjQuery button click refresh of jqGrid only firing once

  • 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-17T14:11:31+00:00Added an answer on June 17, 2026 at 2:11 pm

    I think that you should change

    postData: {
        IdParam: $('#testLogID').val()
    }
    

    to

    postData: {
        IdParam: function () {
            return $('#testLogID').val();
        }
    }
    

    (see my old answer for more information).

    You current code save the value of $('#testLogID').val() at the moment of the grid was created at the first call. Later calls uses the same old value. The usage of function/method inside of postData follows calling the function every time during reloading of the grid. It will be done indirectly: jqGrid use $.ajax which uses $.param which calls the function postData.IdParam.

    Additionally I would recommend you to add gridview: true option and change pager: $('#pager') to pager: "#pager" and move the line var firstClick = true; inside of function $(document).ready(function () {...});. I miss additionally } else { part of if (!firstClick) {. It’s important to understand that one should create grid once with $('#GridTable').jqGrid({...}); and use only $("#GridTable").trigger("reloadGrid"); later.

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

Sidebar

Related Questions

I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
I'm using jqGrid to display some data to users. jqGrid has search functionality that
I'm using jqGrid to display some data on a page. Within the controller action,
I'm using jqgrid to display a list of sites and I want to do
I'm currently using jqGrid to display data. Part of jqGrid's interface will give you
I have a grid using jqgrid . I need to store the some data
I'm using JQGrid to display my data (the server returns xml). The data seems
I am using jqgrid to display data i need Click Here to Edit in
I am having an issue with the using jqGrid with JSON data returned from
I use jqGrid to display data which is retrieved using NHibernate. jqGrid does paging

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.