Commit 2c5ec679 authored by Julia Radzhabova's avatar Julia Radzhabova

Fix Bug 34589.

+ revert Commit: 4cc07218 and fix bug with updating table settings in strict mode: change table style by one user and getting changes by another user (combodataview didn't update).
parent 17142e48
......@@ -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);
......
......@@ -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;
}
},
......
......@@ -357,7 +357,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 )
{
......@@ -366,7 +366,7 @@ define([
//for table-template
var 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
......@@ -663,7 +663,6 @@ define([
item.setDisabled(disable);
});
this.linkAdvanced.toggleClass('disabled', disable);
return !disable;
}
},
......
......@@ -325,7 +325,7 @@ define([
if (this._initSettings)
this.createDelayedControls();
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 )//formatTableInfo
{
......@@ -395,7 +395,7 @@ define([
//for table-template
value = props.asc_getTableStyleName();
if (this._state.TemplateName!==value || this._isTemplatesChanged || updateState) {
if (this._state.TemplateName!==value || this._isTemplatesChanged) {
this.cmbTableTemplate.suspendEvents();
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({
name: value
......@@ -509,7 +509,6 @@ define([
item.setDisabled(disable);
});
this.linkAdvanced.toggleClass('disabled', disable);
return !disable;
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment