tags:

views:

30

answers:

1

Hello,

I have setup in jqGrid a delete function call that uses the native features for checking if a row have been selected in the grid or not as in the following code sample:

$("#myGrid").jqGrid('navGrid', '#pager',
     { add: true, addtitle: 'Add record',
       edit: true, edittitle: 'Edit record',
       del: true, deltitle: 'Delete record',
       addfunc: addFulfilment, editfunc: editFulfilment
     },
     {}, // default settings for edit
     {}, // default settings for add
     {
         // define settings for Delete 
         mtype: "post",
         reloadAfterSubmit: false,
         onclickSubmit: function (rp_ge, postdata) {
             rp_ge.url = '/Customer/Delete/' + postdata;
         }
     }, 
     {}, // search options
     {}
);

This works fine showing a confirm message before the delete method get called.

Is there a way to customize the delete message that appear on the popup window?

+1  A: 

You can set $.jgrid.del.msg or redefine other parameters from the localization file like grid.locale-en.js:

del : {
    caption: "Delete",
    msg: "Delete selected record(s)?",
    bSubmit: "Delete",
    bCancel: "Cancel"
},

You can overwrite some parameters only for one grid using additional prmDel option of the navGrid with the same name (msg for example). Inside of navGrid the default values $.jgrid.del will be combined with the current prmDel options.

Oleg
@Oleg: Thanks! Is there a way to customize the popup dialog? I mean dimension, the fact that is resizable and so on?
Lorenzo
@Lorenzo: If you need more customizations you can define additional CSS parameters of the classes used in the Delete dialog: `delmsg`, `formdata`. In the CSS you can make some changes only for ids like "delmodnav"+grid.id and so on. I recommend you examine the dialog with some developer tools in IE, FF or Chrome. Corresponding CSS definition based on the classes or ids should solve all your problems.
Oleg
@Oleg: Thank you very much for helping :)
Lorenzo
@Lorenzo: You welcome!
Oleg