[SSE] Pivot: move and remove fields
This commit is contained in:
parent
0769337af5
commit
4239a5a546
|
@ -141,6 +141,7 @@ define([
|
||||||
style : 'width: 100%;',
|
style : 'width: 100%;',
|
||||||
allowBlank : true,
|
allowBlank : true,
|
||||||
validateOnChange: true,
|
validateOnChange: true,
|
||||||
|
validateOnBlur: false,
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -158,6 +159,7 @@ define([
|
||||||
}).on('change', function(field, newValue) {
|
}).on('change', function(field, newValue) {
|
||||||
me.txtDestRange.setDisabled(newValue);
|
me.txtDestRange.setDisabled(newValue);
|
||||||
me.btnSelectDest.setDisabled(newValue);
|
me.btnSelectDest.setDisabled(newValue);
|
||||||
|
me.txtDestRange.showError();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.radioExist = new Common.UI.RadioBox({
|
this.radioExist = new Common.UI.RadioBox({
|
||||||
|
@ -167,6 +169,7 @@ define([
|
||||||
}).on('change', function(field, newValue) {
|
}).on('change', function(field, newValue) {
|
||||||
me.txtDestRange.setDisabled(!newValue);
|
me.txtDestRange.setDisabled(!newValue);
|
||||||
me.btnSelectDest.setDisabled(!newValue);
|
me.btnSelectDest.setDisabled(!newValue);
|
||||||
|
me.txtDestRange.cmpEl.find('input').focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.afterRender();
|
this.afterRender();
|
||||||
|
|
|
@ -483,22 +483,22 @@ define([
|
||||||
caption : this.txtMoveFilter,
|
caption : this.txtMoveFilter,
|
||||||
checkable : false
|
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({
|
this.miMoveRow = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveRow,
|
caption : this.txtMoveRow,
|
||||||
checkable : false
|
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({
|
this.miMoveColumn = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveColumn,
|
caption : this.txtMoveColumn,
|
||||||
checkable : false
|
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({
|
this.miMoveValues = new Common.UI.MenuItem({
|
||||||
caption : this.txtMoveValues,
|
caption : this.txtMoveValues,
|
||||||
checkable : false
|
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({
|
this.miRemove = new Common.UI.MenuItem({
|
||||||
caption : this.txtRemove,
|
caption : this.txtRemove,
|
||||||
|
@ -657,7 +657,10 @@ define([
|
||||||
|
|
||||||
onRemove: function() {
|
onRemove: function() {
|
||||||
if (this.api && !this._locked && this._state.field){
|
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;
|
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) {
|
disableControls: function(disable) {
|
||||||
if (this._initSettings) return;
|
if (this._initSettings) return;
|
||||||
|
|
|
@ -275,7 +275,6 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.g_debug_mode = true;
|
window.g_debug_mode = true;
|
||||||
debugger;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- debug begin -->
|
<!-- debug begin -->
|
||||||
|
|
Loading…
Reference in a new issue