jqGrid - How to modify form_editing construction?

2019-01-08 01:52发布

问题:

In the jqGrid documentation to form_editing, I see how the form_editing is constructed.

<form ...>
    <table>
        <tr id='tr_myfield'>  
          <td> Caption</td> 
          <td>edited element named, in colModel, as "myfield"</td> 
        </tr> ... 
    </table> 
</form>

Can I change this construction ?

It's necessary to me because I have too many columns to edit in my form and I want to display the form in most userfriendly way. E.g when I have twenty columns to edit in my table. I have twenty rows in my form. But I would obtain one row for two columns. I understood that each rows are identifying by their index, so I can't just have two columns in the same row. But if it's possible to faking it, be sure it's make me happy ^^ (e.g with two tables and a similar id or with form_editing parameters that I don't know ...)

PS : Sorry for my bad English.

回答1:

There are rowpos and colpos properties of formoptions which would be helpful for you.

The demo demonstrate how you can change the standard editing form created by jqGrid to the following

If I understand correct your problem the usage of rowpos and colpos could be very helpful in your case.



回答2:

If you need to customize the form, your best bet may be to create your own page and use a plugin such as jQuery UI Dialog to display your custom form. It will be more work since you cannot use the built-in form editing capabilities of jqGrid, but you will have complete control of the layout of the form.