[SSE] Refactoring formula wizard

This commit is contained in:
Julia Radzhabova 2020-05-15 12:39:06 +03:00
parent ef30e2360f
commit b377c5b10b

View file

@ -264,7 +264,9 @@ define([
if (newValue == oldValue) return;
var index = input.options.index,
arg = me.args[index],
res = me.api.asc_insertFormulaArgument(newValue, index, arg.argType),
values = me.getArgumentsValue();
values[index] = newValue;
var res = me.api.asc_insertArgumentsInFormula(values, index, arg.argType),
argres = res ? res.asc_getArgumentsResult() : undefined;
argres = argres ? argres[index] : undefined;
arg.lblValue.html('= '+ (argres!==null && argres !==undefined ? argres : '<span style="opacity: 0.5; font-weight: bold;">' + arg.argTypeName + '</span>' ));
@ -296,6 +298,14 @@ define([
me.args[argcount].lblValue.html('= '+ ( argres!==null && argres!==undefined ? argres : '<span style="opacity: 0.6; font-weight: bold;">' + me.args[argcount].argTypeName + '</span>'));
},
getArgumentsValue: function() {
var res = [];
this.args.forEach(function(item){
res.push(item.argInput.getValue());
});
return res;
},
getArgType: function(type) {
var str = '';
switch (type) {