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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:53:49+00:00 2026-06-17T11:53:49+00:00

When editing column with edittype: select and multiple: true , jqGrid sends the data

  • 0

When editing column with edittype: select and multiple: true, jqGrid sends the data to the server as comma-separated values. Is that possible to bind some event to this specific column, which will return an array instead of comma-separated values?

I’d like to avoid using serializeEditData event, since

  1. this one is grid-specific, not column-specific which would be a trouble for me – I’m trying to separate column logic from grid logic
  2. it does not sound like a good idea to convert array to string, and the string to the very same array again.
  • 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-17T11:53:50+00:00Added an answer on June 17, 2026 at 11:53 am

    I think that you will have to use edittype: 'custom' in the case and provide your custom implementations of custom_element and custom_value methods of editoptions. If the value from the custom input element will be need to read jqGrid will call custom_value method with the parameter 'get' parameter. Your implementation of custom_value method could return array of items in the case.

    It’s important to understand that in general you will need to implement custom formatter which allows to display array of data which are input for multiselect. Fortunately formatter: "select" has the line

    cellval = cellval + "";
    

    which convert array to comma separated items. Because of the line the array will by converted to string by usage of .join(",") and formatter: "select" successfully accepts arrays as input.

    The demo

    enter image description here

    demonstrates the described above approach. It uses the following code:

    {
        name: "Subcategory",
        width: 250,
        formatter: "select",
        edittype: "custom",
        editoptions: {
            value: {"1": "football", "2": "formula 1", "3": "physics", "4": "mathematics"},
            custom_element: function (value, options) {
                return $.jgrid.createEl.call(this, "select",
                    $.extend(true, {}, options, {custom_element: null, custom_value: null}),
                    value);
            },
            custom_value: function ($elem, operation, value) {
                if (operation === "get") {
                    return $elem.val();
                }
            },
            multiple: true
        }
    }
    

    In the above code I use $.jgrid.createEl to create multivalue select by existing code of jqGrid. The only thing which one need to do is removing of custom_element and custom_value from the options to prevent unneeded call of the methods from setAttributes. If one would modify the line of setAttributes code and include "custom_value" and "custom_element" in the list of excluded attributes the expression $.extend(true, {}, options, {custom_element: null, custom_value: null}) could be reduced to options.

    In the way we get almost the same <select> as using edittype: "select". There are two differences only:

    • the <select> element created inside of edittype: "custom" will have additional attribute class="customelement"
    • the <select> element created inside of edittype: "custom" will be wrapped (will be direct child) inside of <span class="editable">...</span>

    Such differences seems be not important in our case.

    UPDATED: The code of setAttributes method is now fixed in the main code of jqGrid on the gtihub (see the suggestion and the commit). So in the next version of jqGrid (higher as 4.4.1) one could reduce the code of custom_element to

    custom_element: function (value, options) {
        return $.jgrid.createEl.call(this, "select", options, value);
    }
    

    See the corresponding demo.

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

Sidebar

Related Questions

Is it possible to disable editing in jqGrid for certain cells in a column
I'm working with a data grid that contains a Combo Box Column, but editing
I have a GridView that allows editing the values in every column, in every
Is it possible to have the inline editing in the raw data JSON response?
i have a jqgrid with inline editing working fine, my requirement is that i
I have an NSTableView that has one column of editable fields. Cell editing works
I am using Jqgrid for displaying and editing information. In one of the column
Is there a way for SQL to enforce unique column values, that are not
Edit formatter action button is placed to jqgrid column: colModel: [{fixed:true,label: change ,name:_actions,width:($.browser.webkit ==
jqGrid contains quantity column and add to cart button using colmodel below. Inline editing

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.