Pirzada
Pirzada

Reputation: 4713

jqgrid common parameters of the Form Editing Dialogs. How?

I have to apply some common parameters of the Form Editing Dialogs defined in the pager.

Current pager is

.navGrid('#pager10', { edit: true, add: true, del: true, search: true, view: true },

    // Edit
        {},
    // Add
         {},
    // Delete
            {},

    //Search
            {},
    //View
        {}

         );

and I want to use below paramters on all the action like Add, Edit, Delete, View.

How I do this?

{mtype: "POST", closeOnEscape:true, drag: true, resize: true, jqModal: false,
 recreateForm: false, closeAfterEdit: true, closeAfterAdd: true,
 savekey: [true, 13], viewPagerButtons: false }

Upvotes: 0

Views: 2493

Answers (1)

Oleg
Oleg

Reputation: 221997

Together with jQuery.jgrid.defaults defines standard options of jqGrid there are jQuery.jgrid.edit, jQuery.jgrid.view, jQuery.jgrid.del, jQuery.jgrid.nav which you can use. The settings of jQuery.jgrid.edit are common for Add and Edit dialog.

For example,

jQuery.extend(jQuery.jgrid.edit, {
    recreateForm: true,
    jqModal: false,
    closeAfterAdd: true,
    closeAfterEdit: true,
    closeOnEscape:true,
    savekey: [true, 13]);

You can set in the same way some standard event handler which you plan use in all your grids.

You wrote in your question that you want set mtype: "POST", drag: true, resize: true and some other values which are already default (see here). I recommend you to verify which values are already default. Moreover I strictly recommend you to use recreateForm: true and not default recreateForm: false if you use any customizations or event binding of the dialogs.

Upvotes: 1

Related Questions