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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:41:29+00:00 2026-06-04T09:41:29+00:00

My jqGrid work dynamically.So that all options are loaded dynamically too. This options are

  • 0

My jqGrid work dynamically.So that all options are loaded dynamically too.
This options are generated with java Map<String,Object>
All options work very well, but the function name within de map/opts not work.
This is json map generated with java.

"colModel":[...{"formatter":"myFunction","index":"","name":""}]

I did not debug the jqgrid.src.js yet and i think that the problem are with the eval.
the “myFunction” is not called and the undefined is returned.

  • 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-04T09:41:31+00:00Added an answer on June 4, 2026 at 9:41 am

    The formatter option can be a string if it is one of the predefined formatters, but according to the jqGrid docs for custom formatters:

    You can define your own formatter for a particular column. Usually this is a function.

    So jqGrid expects a function to be passed. This is why myFunction works but "myFunction" does not. Anyway, to solve your problem you need to output the code:

    "formatter": myFunction
    

    To go a bit deeper, you can see in the jqGrid source file grid.base.js that the formatter uses a function directly, but if a string is passed that string is passed to $.fn.fmatter:

        formatter = function (rowId, cellval , colpos, rwdat, _act){
            var cm = ts.p.colModel[colpos],v;
            if(typeof cm.formatter !== 'undefined') {
                var opts= {rowId: rowId, colModel:cm, gid:ts.p.id, pos:colpos };
                if($.isFunction( cm.formatter ) ) {
                    v = cm.formatter.call(ts,cellval,opts,rwdat,_act);
                } else if($.fmatter){
                    v = $.fn.fmatter(cm.formatter, cellval,opts, rwdat, _act);
                } else {
                    v = cellVal(cellval);
                }
            } else {
                v = cellVal(cellval);
            }
            return v;
        },
    

    If that function is not already present in jquery.fmatter.js then I would expect an error to occur when the grid attempts to use it.

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

Sidebar

Related Questions

I'm trying to get work this code: $(#list).jqGrid({ url: 'employers.php', datatype: 'json', mtype: 'POST',
JQgrid outputs this html for a left aligned cell - but it is too
I have been struggling quite a bit to get this JQgrid to work with
I am trying to get jqGrid to work off a DOM table that already
Trying to get a JSON output to work with jqGrid 'userdata' option. The example
I'm trying to set format for time in a jqGrid. It does not work.
I've setup a jqGrid like this $('#gridTable').jqGrid({ url: '/GridData/', ... Now if I navigate
I have a jqGrid that's working 100% except that it keeps displaying undefined in
Does anyone know if jqGrid inline editing throws events that can be handled? The
I'm trying to make instrument to simplify work with complex grids of jqGrid ,

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.