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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:06:47+00:00 2026-06-18T03:06:47+00:00

I am writing a custom checkbox formatter and I have trouble understanding where the

  • 0

I am writing a custom checkbox formatter and I have trouble understanding where the offval attribute is used for and what it value should be.

Especially when the value of the editoptions are set. For example editoptions: { value:"Yes:No" }

I can see that the default checkbox formatter always sets the offval to no. This api documentation says it can also be set to off. In the code I also see that the value can be set to the second value of the editoptions. In case of the example to No but this can be any provided value.

So how do I implement the offval attribute for my checkbox formatter? Thanks in advance!

  • 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-18T03:06:48+00:00Added an answer on June 18, 2026 at 3:06 am

    I don’t think that you need to set any offval attribute inside of your custom checkbox formatter. jqGrid set the attribute itself if one uses edittype: "checkbox" (see the part of code). So it seems to me that you don’t need to set offval neither in your custom formatter nor in custom editing control if you create it too.

    By the way in the time when I posted the code of formatter: “clickableCheckbox” I had the same question as you. I didn’t understood the mean of offval and I just included offval="no" in the code. :-). I don’t think that it has any sense, but to be sure one have to test all of cause.

    If you write your custom formatter which you use multiple times I would recommend you to use

    (function ($) {
        "use strict";
        $.extend($.fn.fmatter, {
            yourFormatterName: function (cellValue, options) {
                ....
            }
        });
        $.extend($.fn.fmatter.yourFormatterName, {
            unformat: function (cellValue, options, elem) {
                ...
            }
        });
    }(jQuery));
    

    as prototype of the formatter. In the way you will register new formatter “yourFormatterName” which you can use exactly like any other predefined formatters: you need just use formatter: "yourFormatterName" instead of formatter: "checkbox" in the column definition of the corresponding column. I find this way very practical.

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

Sidebar

Related Questions

I'm writing a custom overlay for a Google Map. I have a serious of
I'm writing custom security attribute and got strange compiler behaviour... When I'm using the
THE PROBLEM: I'm writing custom django model field. In get_db_prep_save(self, value, connection) I need
I am writing a custom control that is a ListView that has a CheckBox
I need help writing custom functions for my casio fx-9860g I have done this
I am working through the tutorials on writing custom spring namespace handlers found here:
I am using Spring Framework . While writing custom queries, I am unable check
I am writing a custom binding handler in Knockout. I want to to pass
I am writing a custom node.js addon by C++ mixed with C program. The
I am writing a custom binding to use $.expandingTextarea with Knockout.js . Following the

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.