jqGrid - Grouping fields in edit form

前端 未结 1 1121
深忆病人
深忆病人 2020-12-10 21:28

It is possible to group some fields in the edit form?

I would like to group some fields together, give them a summarizing name and give the group some different backg

1条回答
  •  心在旅途
    2020-12-10 21:51

    What you can do is almost free modifying of Add or Edit form inside of beforeShowForm callback. I demonstrate the idea on the demo which I quickly made for you. The example shows just an example of what you can do:

    enter image description here

    The corresponding code is

    $.extend($.jgrid.edit, {
        recreateForm: true,
        beforeShowForm: function($form) {
           $('' +
               '
    ' + 'Invice information (all about money):
    ') .insertBefore('#tr_amount'); $('' + '
    ' + 'Delivery information:
    ') .insertBefore('#tr_closed'); } });

    I set $.jgrid.edit only to change beforeShowForm for both "Add" in "Edit" forms. The 'amount' and 'closed' used in .insertBefore('#tr_amount')) and insertBefore('#tr_closed') are the column names from the colModel.

    0 讨论(0)
提交回复
热议问题