diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index d1d56c232..e6816a990 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -85,6 +85,7 @@ define([ this.rootWidth = 0; this.rootHeight = 0; this.rendered = false; + this.needFillComboView = false; this.fieldPicker = new Common.UI.DataView({ cls: 'field-picker', @@ -315,6 +316,7 @@ define([ }, onMenuPickerSelect: function(picker, item, record, fromKeyDown) { + this.needFillComboView = this.disabled; if (this.disabled || fromKeyDown===true) return; this.fillComboView(record, false); @@ -375,6 +377,17 @@ define([ this.cmpEl.toggleClass('disabled', disabled); $('button', this.openButton.cmpEl).toggleClass('disabled', disabled); this.fieldPicker.setDisabled(disabled); + + if (this.needFillComboView && !disabled) { + var picker = this.menuPicker; + if (picker) { + var record = picker.getSelectedRec(); + if (record) { + record = record[0]; + this.fillComboView(record || picker.store.at(0), false); + } + } + } }, isDisabled: function() { @@ -383,6 +396,8 @@ define([ fillComboView: function(record, forceSelect, forceFill) { if (!_.isUndefined(record) && record instanceof Backbone.Model){ + this.needFillComboView = false; + var me = this, store = me.menuPicker.store, fieldPickerEl = $(me.fieldPicker.el); diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 4918b9ba7..9e0012375 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -430,7 +430,7 @@ define([ if (this._initSettings) this.createDelayedElements(); - var updateState = this.disableControls(this._locked); // need to update combodataview after disabled state + this.disableControls(this._locked); // need to update combodataview after disabled state if (props ) { @@ -451,7 +451,7 @@ define([ //for table-template value = props.get_TableStyle(); - if (this._state.TemplateId!==value || this._isTemplatesChanged || updateState) { + if (this._state.TemplateId!==value || this._isTemplatesChanged) { this.cmbTableTemplate.suspendEvents(); var rec = this.cmbTableTemplate.menuPicker.store.findWhere({ templateId: value @@ -773,7 +773,6 @@ define([ item.setDisabled(disable); }); this.linkAdvanced.toggleClass('disabled', disable); - return !disable; } },