From 9a8a40dd09b3048d13eac3d471617c44b06ef616 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 23 Jun 2021 18:07:56 +0300 Subject: [PATCH] [SSE] Fix range validation --- apps/spreadsheeteditor/main/app/view/ProtectDialog.js | 6 ++++-- apps/spreadsheeteditor/main/app/view/ProtectRangesDlg.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ProtectDialog.js b/apps/spreadsheeteditor/main/app/view/ProtectDialog.js index 3c0164bef..fe3da91a0 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectDialog.js @@ -174,8 +174,9 @@ define([ btnHint : this.textSelectData, blankError : this.txtEmpty, validateOnChange: true, + validateOnBlur: false, validation : function(value) { - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.ConditionalFormattingRule, value, false); + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.ConditionalFormattingRule, value, true); return (isvalid!==Asc.c_oAscError.ID.DataRangeError) ? true : me.textInvalidRange; } }); @@ -423,7 +424,8 @@ define([ txtRangeName: 'Title', txtRange: 'Range', txtEmpty: 'This field is required', - textSelectData: 'Select Data' + textSelectData: 'Select Data', + textInvalidRange: 'ERROR! Invalid cells range' }, SSE.Views.ProtectDialog || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/ProtectRangesDlg.js b/apps/spreadsheeteditor/main/app/view/ProtectRangesDlg.js index 24f899200..760571002 100644 --- a/apps/spreadsheeteditor/main/app/view/ProtectRangesDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ProtectRangesDlg.js @@ -166,7 +166,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ProtectRangesDlg.template', arr.push({ name: ranges[i].asc_getName() || '', pwd: ranges[i].asc_isPassword(), - range: ranges[i].asc_getSqref(), + range: ranges[i].asc_getSqref() || '', props: ranges[i], lock: (id!==null && id!==undefined), lockuser: (id) ? this.getUserName(id) : this.guestText