[SSE] Pivot: move and remove fields

This commit is contained in:
Julia Radzhabova 2019-10-11 16:37:27 +03:00
parent 0769337af5
commit 4239a5a546
3 changed files with 32 additions and 6 deletions

View file

@ -141,6 +141,7 @@ define([
style : 'width: 100%;',
allowBlank : true,
validateOnChange: true,
validateOnBlur: false,
disabled: true
});
@ -158,6 +159,7 @@ define([
}).on('change', function(field, newValue) {
me.txtDestRange.setDisabled(newValue);
me.btnSelectDest.setDisabled(newValue);
me.txtDestRange.showError();
});
this.radioExist = new Common.UI.RadioBox({
@ -167,6 +169,7 @@ define([
}).on('change', function(field, newValue) {
me.txtDestRange.setDisabled(!newValue);
me.btnSelectDest.setDisabled(!newValue);
me.txtDestRange.cmpEl.find('input').focus();
});
this.afterRender();

View file

@ -483,22 +483,22 @@ define([
caption : this.txtMoveFilter,
checkable : false
});
// this.miMoveFilter.on('click', _.bind(this.onMoveFilter, this));
this.miMoveFilter.on('click', _.bind(this.onMoveTo, this, 3));
this.miMoveRow = new Common.UI.MenuItem({
caption : this.txtMoveRow,
checkable : false
});
// this.miMoveRow.on('click', _.bind(this.onMoveRow, this));
this.miMoveRow.on('click', _.bind(this.onMoveTo, this, 1));
this.miMoveColumn = new Common.UI.MenuItem({
caption : this.txtMoveColumn,
checkable : false
});
// this.miMoveColumn.on('click', _.bind(this.onMoveColumn, this));
this.miMoveColumn.on('click', _.bind(this.onMoveTo, this, 0));
this.miMoveValues = new Common.UI.MenuItem({
caption : this.txtMoveValues,
checkable : false
});
// this.miMoveValues.on('click', _.bind(this.onMoveValues, this));
this.miMoveValues.on('click', _.bind(this.onMoveTo, this, 2));
this.miRemove = new Common.UI.MenuItem({
caption : this.txtRemove,
@ -657,7 +657,10 @@ define([
onRemove: function() {
if (this.api && !this._locked && this._state.field){
this._originalProps.asc_removeField(this.api, this._state.field.record.get('pivotIndex'));
if (this._state.field.type==2) // value
this._originalProps.asc_removeDataField(this.api, this._state.field.record.get('pivotIndex'), this._state.field.record.get('index'));
else
this._originalProps.asc_removeNoDataField(this.api, this._state.field.record.get('pivotIndex'));
}
},
@ -705,6 +708,27 @@ define([
break;
}
},
onMoveTo: function(type) {
if (this.api && !this._locked && this._state.field){
var pivotIndex = this._state.field.record.get('pivotIndex'),
index = (this._state.field.type==2) ? this._state.field.record.get('index') : undefined;
switch (type) {
case 0:
this._originalProps.asc_moveToColField(this.api, pivotIndex, index);
break;
case 1:
this._originalProps.asc_moveToRowField(this.api, pivotIndex, index);
break;
case 2:
this._originalProps.asc_moveToDataField(this.api, pivotIndex, index);
break;
case 3:
this._originalProps.asc_moveToPageField(this.api, pivotIndex, index);
break;
}
}
},
disableControls: function(disable) {
if (this._initSettings) return;

View file

@ -275,7 +275,6 @@
<script type="text/javascript">
window.g_debug_mode = true;
debugger;
</script>
<!-- debug begin -->