完善编辑表格功能:完善禁用编辑表格时的恢复逻辑

This commit is contained in:
datagear 2018-12-16 21:21:17 +08:00
parent 945e887b62
commit cf9f3d5649
1 changed files with 7 additions and 3 deletions

View File

@ -374,17 +374,21 @@ WebUtils.setPageId(request, gridPageId);
}
else
{
var $editedCells = po.editedCells();
var dataTable = po.table().DataTable();
if($editedCells.length > 1)
var modifiedCells = dataTable.cells(".cell-modified");
var count = modifiedCells.nodes().length;
if(count > 1)
{
event.preventDefault();
event.stopPropagation();
po.confirm("<fmt:message key='data.confirmCancelAllEditedCell'><fmt:param>"+$editedCells.length+"</fmt:param></fmt:message>",
po.confirm("<fmt:message key='data.confirmCancelAllEditedCell'><fmt:param>"+count+"</fmt:param></fmt:message>",
{
"confirm" : function()
{
po.restoreEditCell(dataTable, modifiedCells);
po.disableEditGrid();
$thisCheckbox.attr("checked", false);