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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:22:05+00:00 2026-05-25T03:22:05+00:00

Well i am banging my head against the wall with this one because i

  • 0

Well i am banging my head against the wall with this one because i have used jqgrid in many apps and similar code is working in every other case but this!
Here is the code…

var pfct = $("#pfc_table");
pfct.jqGrid({
        url: 'costs',
        datatype: 'json',
        'postData': JSON.stringify(getConds()),
        mtype: 'POST',
        colNames:['Id','Name','Formula','Conditions'],
        colModel :[
          {name:'id', index:'id', width:40, search:true},
          {name:'name', index:'name', width:130, search:true},
          {
              name:'formula', index:'formula',width:310, search:true,
              formatter : function(value, options, rData){
                  return value.substring(value.indexOf('=')+1);
              }
          },
          {name:'conditionstr', index:'conditionstr', width:160,search:true}
        ],
        jsonReader: {
            repeatitems:false,
            root: function (r) { return r.data.rows; },
            page: function (r) { return r.data.currpage; },
            total: function (r) { return r.data.totalpages; },
            records: function (r) { return r.data.totalrecords; }
        },
        gridComplete: function() {
        },
        gridview: true,
        height: 'auto',
        autowidth: true,
        pager: '#pfc_pager',
        rowNum:25,
        viewrecords: true,
        loadonce: true,
        ignoreCase: true,
        multiselect: false,
        pagination: true
});
pfct.navGrid('#pfc_pager',{edit:false,add:false,del:false,search:false,refresh:false});
pfct.jqGrid('filterToolbar',{stringResult: true,searchOnEnter: false});

The json data i am sending have a few extra properties that are not defined in the colmodel but this has never been a problem in the past. Local sorting and paging works fine, but filtering does not!
For the record this is what the data looks like:

{"data":{"totalpages":1,"currpage":1,"totalrecords":10,"rows":[{"name":"Test","id":18195,"level":0,"currency":"EUR","default":true,"formula":"f_18195()=110","ownerId":1,"categoryName":"Test cat","parentId":0,"rebate":0,"portDues":true,"modified":1310036286000,"conditionstr":"Condition 1, Condition 2"}],"userdata":null},"status":true,"responseError":null}
  • 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-25T03:22:06+00:00Added an answer on May 25, 2026 at 3:22 am

    Your original grid has one problem. You use custom formatter for the ‘formula’ column:

    formatter : function(value, options, rData){
        return value.substring(value.indexOf('=')+1);
    }
    

    so the data "f_18195()=110" will be displayed as "100". The way works good in case of datatype: 'json' without loadonce: true, but works wrong in case of loadonce: true. The problem is that the data saved locally for the formula column will be "f_18195()=110" and not "100". So during filtering of the data one have to type “f” or “f_18195()=1” instead of “1” to filter the data:

    enter image description here

    You can fix the problem if you would use jsonmap as function:

    jsonmap: function (obj) {
        var f = obj.formula;
        return f.substring(f.indexOf('=')+1);
    }
    

    instead of usage of usage of custom formatter for the ‘formula’ column. In the case the value “100” will be saved locally and the filtering of data works as expected:

    enter image description here

    See the corresponding demo here.

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

Sidebar

Related Questions

I've spent much too long banging my head against a wall for this one.
Been banging my head against this one for a while, and figured I'd turn
I have been banging my head against this for 2 days solid now and
I've been banging my head against this one all day long. Time to ask
been banging my head against this one for a while. For a CSS redesign
I've been banging my head against a wall for the past hour trying to
I have been banging my head on the desk for several days over this
So, I've been banging my head against the wall for at least an hour
I've been banging my head against this for a few days without getting anywhere.
So instead of banging my head against the wall for another couple of hours,

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.