diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index 1a1681619..f538650ec 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -183,6 +183,8 @@ define([ _options.tpl = _.template(this.template)(_options); + this._previewTdWidth = []; + this._previewTdMaxLength = 0; Common.UI.Window.prototype.initialize.call(this, _options); }, render: function () { @@ -417,6 +419,9 @@ define([ }, updatePreview: function() { + this._previewTdWidth = []; + this._previewTdMaxLength = 0; + var encoding = (this.cmbEncoding && !this.cmbEncoding.isDisabled()) ? this.cmbEncoding.getValue() : ((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : 0); var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null, @@ -488,15 +493,24 @@ define([ if (str.length>maxlength) maxlength = str.length; } + this._previewTdMaxLength = Math.max(this._previewTdMaxLength, maxlength); var tpl = '
' + Common.Utils.String.htmlEncode(str[j]) + ' | '; } - for (j=str.length; j