[SSE] Fix named ranges for slicer

This commit is contained in:
Julia Radzhabova 2020-06-10 15:32:23 +03:00
parent 7c2fc19882
commit a9850f64b3
2 changed files with 17 additions and 5 deletions

View file

@ -2146,10 +2146,22 @@ define([
var type = menuItem.asc_getType(),
name = menuItem.asc_getName(true),
origname = me.api.asc_getFormulaNameByLocale(name),
mnu = new Common.UI.MenuItem({
iconCls: 'menu__icon ' + ((type==Asc.c_oAscPopUpSelectorType.Func) ? 'btn-function': ((type==Asc.c_oAscPopUpSelectorType.Table) ? 'btn-menu-table' : 'btn-named-range')) ,
caption: name,
hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : ''
iconCls = 'btn-named-range';
switch (type) {
case Asc.c_oAscPopUpSelectorType.Func:
iconCls = 'btn-function';
break;
case Asc.c_oAscPopUpSelectorType.Table:
iconCls = 'btn-menu-table';
break;
case Asc.c_oAscPopUpSelectorType.Slicer:
iconCls = 'btn-slicer';
break;
}
var mnu = new Common.UI.MenuItem({
iconCls: 'menu__icon ' + iconCls ,
caption: name,
hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : ''
}).on('click', function(item, e) {
setTimeout(function(){ me.api.asc_insertInCell(item.caption, type, false ); }, 10);
});

View file

@ -195,7 +195,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
name: this.ranges[i].asc_getName(true),
scope: scope,
scopeName: (scope===null) ? this.textWorkbook: this.sheetNames[scope],
range: this.ranges[i].asc_getRef(),
range: (type===Asc.c_oAscDefNameType.slicer) ? '' : this.ranges[i].asc_getRef(),
lock: (id!==null && id!==undefined),
lockuser: (id) ? this.getUserName(id) : this.guestText,
type: type,