jqgrid custom delete dialog message

和自甴很熟 提交于 2019-12-29 04:22:05

问题


I want to customize the delete dialog message. Based on a selected row? I want to display a message something like "Delete selected row: $selectedRow.columnValue? " How can i do that?


回答1:


You can use beforeShowForm or afterShowForm of the delGridRow to overwrite the text of the conformation dialog.

For example

beforeShowForm: function ($form) {
    $("td.delmsg", $form[0]).html("Do you really want delete the row with <b>id=" +
         $("#list").jqGrid('getGridParam','selrow') + "</b>?");
}

(see the old demo) will display the confirmation dialog like the following:

You can easy modify the example to display any other information about the deleting row. You can use getRowData or getCell to get some information from the deleting row.

UPDATED: See the answer for additional information.




回答2:


if you start dialog with $('#dialog_id') then before you open your dialog change his html

$('#dialog_id').html('Delete selected row:' + $selectedRow.columnValue?);
$('#dialog_id').dialog();


来源:https://stackoverflow.com/questions/6913618/jqgrid-custom-delete-dialog-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!