Fix Bug 34589. 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).
This commit is contained in:
parent
aa03115dd2
commit
358154cb62
|
@ -85,6 +85,7 @@ define([
|
||||||
this.rootWidth = 0;
|
this.rootWidth = 0;
|
||||||
this.rootHeight = 0;
|
this.rootHeight = 0;
|
||||||
this.rendered = false;
|
this.rendered = false;
|
||||||
|
this.needFillComboView = false;
|
||||||
|
|
||||||
this.fieldPicker = new Common.UI.DataView({
|
this.fieldPicker = new Common.UI.DataView({
|
||||||
cls: 'field-picker',
|
cls: 'field-picker',
|
||||||
|
@ -315,6 +316,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
|
onMenuPickerSelect: function(picker, item, record, fromKeyDown) {
|
||||||
|
this.needFillComboView = this.disabled;
|
||||||
if (this.disabled || fromKeyDown===true) return;
|
if (this.disabled || fromKeyDown===true) return;
|
||||||
|
|
||||||
this.fillComboView(record, false);
|
this.fillComboView(record, false);
|
||||||
|
@ -375,6 +377,17 @@ define([
|
||||||
this.cmpEl.toggleClass('disabled', disabled);
|
this.cmpEl.toggleClass('disabled', disabled);
|
||||||
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
|
$('button', this.openButton.cmpEl).toggleClass('disabled', disabled);
|
||||||
this.fieldPicker.setDisabled(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() {
|
isDisabled: function() {
|
||||||
|
@ -383,6 +396,8 @@ define([
|
||||||
|
|
||||||
fillComboView: function(record, forceSelect, forceFill) {
|
fillComboView: function(record, forceSelect, forceFill) {
|
||||||
if (!_.isUndefined(record) && record instanceof Backbone.Model){
|
if (!_.isUndefined(record) && record instanceof Backbone.Model){
|
||||||
|
this.needFillComboView = false;
|
||||||
|
|
||||||
var me = this,
|
var me = this,
|
||||||
store = me.menuPicker.store,
|
store = me.menuPicker.store,
|
||||||
fieldPickerEl = $(me.fieldPicker.el);
|
fieldPickerEl = $(me.fieldPicker.el);
|
||||||
|
|
|
@ -430,7 +430,7 @@ define([
|
||||||
if (this._initSettings)
|
if (this._initSettings)
|
||||||
this.createDelayedElements();
|
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 )
|
if (props )
|
||||||
{
|
{
|
||||||
|
@ -451,7 +451,7 @@ define([
|
||||||
|
|
||||||
//for table-template
|
//for table-template
|
||||||
value = props.get_TableStyle();
|
value = props.get_TableStyle();
|
||||||
if (this._state.TemplateId!==value || this._isTemplatesChanged || updateState) {
|
if (this._state.TemplateId!==value || this._isTemplatesChanged) {
|
||||||
this.cmbTableTemplate.suspendEvents();
|
this.cmbTableTemplate.suspendEvents();
|
||||||
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({
|
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({
|
||||||
templateId: value
|
templateId: value
|
||||||
|
@ -773,7 +773,6 @@ define([
|
||||||
item.setDisabled(disable);
|
item.setDisabled(disable);
|
||||||
});
|
});
|
||||||
this.linkAdvanced.toggleClass('disabled', disable);
|
this.linkAdvanced.toggleClass('disabled', disable);
|
||||||
return !disable;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue