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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:34:30+00:00 2026-05-27T14:34:30+00:00

Is there any way to disable jqgrid local cache??? I have a page which

  • 0

Is there any way to disable jqgrid local cache???
I have a page which you build some filters and based on this params I create the jqgrid.

The problem is that jqgrid doesn’t change postdata params! I’m mean, on the second, third, fourth, etc search, the results is always equals the first one.
My jqgrid defaults are:

jQuery.extend(jQuery.jgrid.defaults, {
        ajaxGridOptions: {
            contentType: 'application/json;',
            type: "POST",
            cache: false,
            beforeSend: function () {
                $(".loading").show(); 
            }
        },
        serializeGridData: function (postData) {
            return JSON.stringify(postData);
        },
        datatype: 'json',
        autowidth: true,
        height: '100%',
        rowNum: 10,
        rowList: [10, 20, 30],
        hidegrid: false,
        prmNames: {
            search: "isSearch",
            nd: null,
            rows: "numRows",
            page: "numPage",
            sort: "orderBy",
            order: "orderType"
        },
        viewrecords: true,
        gridComplete: function () {
            $(".loading").hide();
        },
        jsonReader: {
            root: function (obj) { return obj.d.rows; },
            page: function (obj) { return obj.d.page; },
            total: function (obj) { return obj.d.total; },
            records: function (obj) { return obj.d.rows.length; },
            repeatitems: false
        }
    });

The jqGrid creation:

$myGrid.jqGrid({
      postData: { from: jQuery.parseDate(fromQueryString), to: jQuery.parseDate(toQueryString) },
      url: "/Search.aspx/Find",
      colNames: ['Test'],
      colModel: [
         { name: 'Test', index: 'Test', sortable: false, width: 40 }
      ],
      sortname: "Date",
      sortorder: "desc",
      jsonReader: { id: "ID" },
      pager: "pagerControl",
      caption: "Results"
 });
  • 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-27T14:34:31+00:00Added an answer on May 27, 2026 at 2:34 pm

    If I understand you correctly, the page has come controls build some controls like input#from and input#to (<input> fields with ids “from” and “to”) which defines the interval which you what to send to the server together with other parameters.

    I suppose that you code looks like

    var $myGrid = $("#list"),
        fromQueryString = "",
        toQueryString = "",
        createGrid = function () {
            $myGrid.jqGrid({
                postData: {
                    from: jQuery.parseDate(fromQueryString),
                    to: jQuery.parseDate(toQueryString)
                },
                url: "/Search.aspx/Find",
                colNames: ['Test'],
                colModel: [
                    { name: 'Test', index: 'Test', sortable: false, width: 40 }
                ],
                sortname: "Date",
                sortorder: "desc",
                jsonReader: { id: "ID" },
                pager: "pagerControl",
                caption: "Results"
            });
        },
        myRefresh = function () {
            var fromQueryString = $("#from").val(),
                toQueryString = $("#to").val();
    
            createGrid();
        };
    
    $("#from").change(myRefresh);
    $("#from").change(myRefresh);
    createGrid();
    

    The problem is that the above code is wrong. The createGrid create grid only at the first time and then (inside of myRefresh) it just dose nothing after the test that the grid $myGrid is already created. You can understand this it you imagine that many parts of the grid: the title, the column headers, the pager and so on must be created only once. At the next time one need just reload the content of the grid body.

    The correct way to refresh jqGrid will be call of .trigger("reloadGrid") instead of trying to create the grid multiply times. One can fix the code to the following

    var $myGrid = $("#list"),
        fromQueryString = "",
        toQueryString = "",
        createGrid = function () {
            $myGrid.jqGrid({
                postData: {
                    from: function () {
                        return jQuery.parseDate($("#from").val());
                    },
                    to: function () {
                        jQuery.parseDate($("#to").val());
                    }
                },
                url: "/Search.aspx/Find",
                colNames: ['Test'],
                colModel: [
                    { name: 'Test', index: 'Test', sortable: false, width: 40 }
                ],
                sortname: "Date",
                sortorder: "desc",
                jsonReader: { id: "ID" },
                pager: "pagerControl",
                caption: "Results"
            });
        },
        myRefresh = function () {
            $myGrid.trigger("reloadGrid", [{page: 1}]);
        };
    
    $("#from").change(myRefresh);
    $("#from").change(myRefresh);
    createGrid();
    

    In the case the methods from and to of the postData will be called on every grid reload. For example if the user click on the column header to change the grid sorting or if the user choose to display another page of the grid. You can read here more about the approach.

    The only thing what you can change additionally is the code of serializeGridData which should test the properties of postData and call the function if needed. See here for details.

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

Sidebar

Related Questions

Is there any way to disable Cache (System.Web.Caching.Cache, not OutPut cache for aspx page)
Is there any way to disable zooming when Scales page to Fit is ON
Is there any way to disable this 'feature'? For example, if a request is
Is there any way to disable javascript when generating a page with php? Code:
Is there any way to disable the Download This Video button from RealPlayer. It
Is there any way to disable localization in an Android application? It must use
Is there any way to disable certain metrics from selected packages in Sonar? I
Is there any way to disable all input fields in an div container with
Is there any way to disable entire form using jQuery after submission?
is there any way to disable a feature in the featuretree of Wix, when

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.