[SSE] Fix view settings

This commit is contained in:
Julia Radzhabova 2020-07-10 14:47:26 +03:00
parent ed0860d4d1
commit 54a589a29b
2 changed files with 11 additions and 20 deletions

View file

@ -171,7 +171,12 @@ define([
var me = this; var me = this;
(new SSE.Views.ViewManagerDlg({ (new SSE.Views.ViewManagerDlg({
api: this.api, api: this.api,
handler: function(result) { handler: function(result, value) {
if (result == 'ok' && value) {
if (me.api) {
me.api.asc_setActiveNamedSheetView(value);
}
}
Common.NotificationCenter.trigger('edit:complete', me.view); Common.NotificationCenter.trigger('edit:complete', me.view);
}, },
views: this.api.asc_getNamedSheetViews() views: this.api.asc_getNamedSheetViews()

View file

@ -89,14 +89,13 @@ define([
'</div>', '</div>',
'<div class="separator horizontal"></div>', '<div class="separator horizontal"></div>',
'<div class="footer center">', '<div class="footer center">',
'<button class="btn normal dlg-btn" result="apply" style="width: 86px;">' + this.textGoTo + '</button>', '<button class="btn normal dlg-btn primary" result="ok" style="width: 86px;">' + this.textGoTo + '</button>',
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>', '<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + this.closeButtonText + '</button>',
'</div>' '</div>'
].join('') ].join('')
}, options); }, options);
this.api = options.api; this.api = options.api;
this.handler = options.handler;
this.views = options.views || []; this.views = options.views || [];
this.userTooltip = true; this.userTooltip = true;
this.currentView = undefined; this.currentView = undefined;
@ -261,21 +260,12 @@ define([
} }
} }
})).show(); })).show();
this.api.asc_deleteNamedSheetViews([rec.get('view')]);
} }
}, },
getSettings: function() { getSettings: function() {
return this.sort; var rec = this.viewList.getSelectedRec();
}, return rec ? rec.get('name') : null;
onPrimary: function() {
return true;
},
onDlgBtnClick: function(event) {
this.handler && this.handler.call(this, event.currentTarget.attributes['result'].value);
this.close();
}, },
getUserName: function(id){ getUserName: function(id){
@ -305,16 +295,11 @@ define([
} }
}, },
hide: function () {
this.userTipHide();
Common.UI.Window.prototype.hide.call(this);
},
close: function () { close: function () {
this.userTipHide(); this.userTipHide();
this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList); this.api.asc_unregisterCallback('asc_onRefreshNamedSheetViewList', this.wrapEvents.onRefreshNamedSheetViewList);
Common.UI.Window.prototype.close.call(this); Common.Views.AdvancedSettingsWindow.prototype.close.call(this);
}, },
onKeyDown: function (lisvView, record, e) { onKeyDown: function (lisvView, record, e) {
@ -323,6 +308,7 @@ define([
}, },
onDblClickItem: function (lisvView, record, e) { onDblClickItem: function (lisvView, record, e) {
this.onPrimary();
}, },
txtTitle: 'Sheet View Manager', txtTitle: 'Sheet View Manager',