jqGrid navigator - how to specyfy settings globally?

后端 未结 1 1199
星月不相逢
星月不相逢 2020-12-06 23:32

I\'m using Navigator with jqGrid and I\'m repeating over and over settings such as:

savekey: [true, 13],
closeOnEscape: true,
closeAfterAdd: true


        
相关标签:
1条回答
  • 2020-12-07 00:01

    The object jQuery.jgrid.edit is responsible for the default setting of Add and Edit forms, so you can include in your common JavaScript code the following:

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

    The recreateForm:true option is another option which I recommend you to use if you use some events in the Edit or Add form.

    Another settings jQuery.jgrid.nav, jQuery.jgrid.del, jQuery.jgrid.view and of course jQuery.jgrid.defaults can be also helpful and can be used in the same way as jQuery.jgrid.edit above. For example,

    jQuery.extend(jQuery.jgrid.nav, {search: false});
    

    The settings edit:true, add:true, del:true are already default (see the source code of navGrid)

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