[SSE] Fix category settings

This commit is contained in:
Julia Radzhabova 2020-07-07 16:19:30 +03:00
parent 2ae33bdfb2
commit 3bfd4182fc
2 changed files with 16 additions and 4 deletions

View file

@ -278,6 +278,7 @@ define([
(len>0) && this.categoryList.selectByIndex(0);
}
this.updateButtons();
this.updateCatButtons();
},
getSettings: function () {
@ -412,6 +413,7 @@ define([
},
onSelectSeries: function(lisvView, itemView, record) {
this.updateCatButtons(record.get('series').asc_IsScatter());
this.updateMoveButtons();
},
@ -422,8 +424,12 @@ define([
this.updateMoveButtons();
},
updateCatButtons: function() {
this.btnEditCategory.setDisabled(this.categoryList.store.length<1);
updateCatButtons: function(isScatter) {
if (isScatter===undefined) {
var rec = this.seriesList.getSelectedRec();
rec && (isScatter = rec.get('series').asc_IsScatter());
}
this.btnEditCategory.setDisabled(this.categoryList.store.length<1 || !!isScatter);
},
updateMoveButtons: function() {
@ -483,7 +489,7 @@ define([
var changedValue = dlg.getSettings();
}
};
this.changeDataRange(0, false, handlerDlg);
this.changeDataRange(0, {category: '', values: this.chartSettings.getCatValues()}, false, handlerDlg);
},
changeDataRange: function(type, props, add, handlerDlg) {

View file

@ -193,6 +193,10 @@ define([
this.inputRange2.setValue(series.asc_getValues());
(this.inputRange2.getValue()!=='') && this.lblRange2.html('= ' + series.asc_getValuesArr().join('; '));
}
} else {
this.inputRange1.setValue(this.props.category || '');
// if (this.inputRange1.getValue()!=='')
this.props.values && this.lblRange1.html('= ' + this.props.values.join('; '));
}
},
@ -244,7 +248,9 @@ define([
if (state == 'ok') {
if (this.inputRange1.checkValidate() !== true)
return;
if (type==1 && this.inputRange2.checkValidate() !== true)
if (this.type==1 && this.inputRange2.checkValidate() !== true)
return;
if (this.type==1 && this.isScatter && this.inputRange3.checkValidate() !== true)
return;
}
if (this.options.handler.call(this, this, state))