[SSE] Refactoring data from file

This commit is contained in:
Julia Radzhabova 2021-03-23 11:43:12 +03:00
parent d1ff42ccd8
commit 1f62dbf053
2 changed files with 3 additions and 7 deletions

View file

@ -73,7 +73,6 @@ define([
height = options.warning ? 187 : 147; height = options.warning ? 187 : 147;
break; break;
} }
// height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147);
} }
_.extend(_options, { _.extend(_options, {
@ -423,7 +422,7 @@ define([
options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal); options.asc_setNumberDecimalSeparator(this.separatorOptions.decimal);
options.asc_setNumberGroupSeparator(this.separatorOptions.thousands); options.asc_setNumberGroupSeparator(this.separatorOptions.thousands);
} }
this.api.asc_TextFromFileOrUrl(options, _.bind(this.previewCallback, this), undefined, true); this.api.asc_decodeBuffer(this.preview, options, _.bind(this.previewCallback, this));
break; break;
} }
}, },

View file

@ -253,16 +253,13 @@ define([
} }
}, },
onDataFromTextCallback: function(data, advOptions) { onDataFromTextCallback: function(advOptions) {
if (!data || !data.length) return;
var me = this; var me = this;
(new Common.Views.OpenDialog({ (new Common.Views.OpenDialog({
title: me.txtImportWizard, title: me.txtImportWizard,
closable: true, closable: true,
type: Common.Utils.importTextType.Data, type: Common.Utils.importTextType.Data,
preview: true, preview: advOptions.asc_getData(),
previewData: data,
settings: advOptions ? advOptions.asc_getRecommendedSettings() : me._state.CSVOptions, settings: advOptions ? advOptions.asc_getRecommendedSettings() : me._state.CSVOptions,
codepages: advOptions ? advOptions.asc_getCodePages() : null, codepages: advOptions ? advOptions.asc_getCodePages() : null,
api: me.api, api: me.api,