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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:46:15+00:00 2026-05-23T23:46:15+00:00

Normally in a jqGrid edit form, every field is on a separate line, label

  • 0

Normally in a jqGrid edit form, every field is on a separate line, label on the left, field input on the right. However, in some of our grids, we have fields which the users would like to appear next to each other in the edit form, because they are logically related, e.g. quarter and year in one line with one label on the left.

The only way I see this being possible is by using a custom formatter with edittype:'custom' in which case the two or more fields will have to be split/merged when loading/saving respectively.

Sort of resorting to this horrendous and tedious approach, is there a better/easier way to do this?

  • 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-23T23:46:16+00:00Added an answer on May 23, 2026 at 11:46 pm

    You can use beforeShowForm or afterShowForm to modify the form.

    You should take in considerations, that the form data will be placed in the <table> having id like "TblGrid_"+grid_id. The rows of the table has ids like tr_myCol where the name 'myCol' is the value of the name property from the corresponding grid column from colModel. So you can append the <tr> element with new <td> element with an additional information which you need. Of cause you should probably increase the value of the width property of the form.

    The old answer could be probably helpful for you.

    UPDATED: If you examine the code of jqGrid you will find the following code fragments in the getFormData of grid.formedit.js:

    $("#"+frmtb+" > tbody > tr > td > .FormElement").each(function(i) {
        ...
        switch ($(this).get(0).type) {
            ...
            case "text":
                postdata[this.name] = $(this).val();
        ...
    }
    

    So it is only important that the input, select and other input elements stay somewhere inside of and <td> cell of the same table of the form. The input element for the "invdate" column for example will have (in simplified form)

     <input class="FormElement" name="invdate" type="text">
    

    So it has already all fields which you need. You can reorder the input field like you as want. You can add additional <tr> or <td> elements or remove it. You can for example reduce the table to one <tr> and one <td> cell and place all input fields and labels inside the cell. It seems to me that the Edit form will stay working without any problem.

    So you can really make a lot of modifications in the Edit/Add forms.

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

Sidebar

Related Questions

Normally it just puts multiline content on a one liner field and adds slightly
Normally you would have a single ErrorProvider for all the controls on a form;
normally you go on a website and by right click you can choose to
Normally, I run Linux in a VM, however, most of my VMs are on
Normally an application bundle on OS X can only be started once, however by
Normally my form prevented users to submit it when it was under 4 characters.
Normally when you hit tab on an empty line in emacs python mode it
Normally when I want to run a php script from the command line I
Normally you create a function using cfscript like: <cfscript> function foo() { return bar;
Normally I use imagecreatefromjpeg() and then getimagesize() , but with Firefox 3 I need

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.