[SSE] Refresh pivot table.
This commit is contained in:
parent
c0bb96eb7a
commit
43f716beed
|
@ -58,6 +58,7 @@ define([
|
||||||
// comments handlers
|
// comments handlers
|
||||||
'pivottable:rowscolumns': _.bind(this.onCheckTemplateChange, this),
|
'pivottable:rowscolumns': _.bind(this.onCheckTemplateChange, this),
|
||||||
'pivottable:create': _.bind(this.onCreateClick, this),
|
'pivottable:create': _.bind(this.onCreateClick, this),
|
||||||
|
'pivottable:refresh': _.bind(this.onRefreshClick, this),
|
||||||
'pivottable:style': _.bind(this.onPivotStyleSelect, this),
|
'pivottable:style': _.bind(this.onPivotStyleSelect, this),
|
||||||
'pivottable:layout': _.bind(this.onPivotLayout, this),
|
'pivottable:layout': _.bind(this.onPivotLayout, this),
|
||||||
'pivottable:blankrows': _.bind(this.onPivotBlankRows, this),
|
'pivottable:blankrows': _.bind(this.onPivotBlankRows, this),
|
||||||
|
@ -138,6 +139,10 @@ define([
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onRefreshClick: function(btn, opts){
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
|
},
|
||||||
|
|
||||||
onPivotStyleSelect: function(record){
|
onPivotStyleSelect: function(record){
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
this._originalProps.asc_getStyleInfo().asc_setName(this.api, this._originalProps, record.get('name'));
|
this._originalProps.asc_getStyleInfo().asc_setName(this.api, this._originalProps, record.get('name'));
|
||||||
|
|
|
@ -63,6 +63,10 @@ define([
|
||||||
'<span id="slot-btn-pivot-grand-totals" class="btn-slot text x-huge"></span>' +
|
'<span id="slot-btn-pivot-grand-totals" class="btn-slot text x-huge"></span>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="separator long"/>' +
|
'<div class="separator long"/>' +
|
||||||
|
'<div class="group">' +
|
||||||
|
'<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="separator long"/>' +
|
||||||
'<div class="group">' +
|
'<div class="group">' +
|
||||||
'<div class="elset">' +
|
'<div class="elset">' +
|
||||||
'<span class="btn-slot text" id="slot-chk-header-row"></span>' +
|
'<span class="btn-slot text" id="slot-chk-header-row"></span>' +
|
||||||
|
@ -106,6 +110,10 @@ define([
|
||||||
me.fireEvent('pivottable:grandtotals', [item.value]);
|
me.fireEvent('pivottable:grandtotals', [item.value]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.btnRefreshPivot.on('click', function (e) {
|
||||||
|
me.fireEvent('pivottable:refresh');
|
||||||
|
});
|
||||||
|
|
||||||
this.chRowHeader.on('change', function (field, value) {
|
this.chRowHeader.on('change', function (field, value) {
|
||||||
me.fireEvent('pivottable:rowscolumns', [0, value]);
|
me.fireEvent('pivottable:rowscolumns', [0, value]);
|
||||||
});
|
});
|
||||||
|
@ -222,6 +230,13 @@ define([
|
||||||
});
|
});
|
||||||
this.lockedControls.push(this.btnPivotGrandTotals);
|
this.lockedControls.push(this.btnPivotGrandTotals);
|
||||||
|
|
||||||
|
this.btnRefreshPivot = new Common.UI.Button({
|
||||||
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
|
iconCls: 'btn-ic-docspell',
|
||||||
|
caption: this.txtRefresh
|
||||||
|
});
|
||||||
|
// this.lockedControls.push(this.btnRefreshPivot);
|
||||||
|
|
||||||
this.pivotStyles = new Common.UI.ComboDataView({
|
this.pivotStyles = new Common.UI.ComboDataView({
|
||||||
cls : 'combo-pivot-template',
|
cls : 'combo-pivot-template',
|
||||||
enableKeyEvents : true,
|
enableKeyEvents : true,
|
||||||
|
@ -248,10 +263,11 @@ define([
|
||||||
accept();
|
accept();
|
||||||
})).then(function(){
|
})).then(function(){
|
||||||
me.btnAddPivot.updateHint(me.tipCreatePivot);
|
me.btnAddPivot.updateHint(me.tipCreatePivot);
|
||||||
|
me.btnRefreshPivot.updateHint(me.tipRefresh);
|
||||||
me.btnPivotLayout.updateHint(me.capLayout);
|
me.btnPivotLayout.updateHint(me.capLayout);
|
||||||
me.btnPivotBlankRows.updateHint(me.capBlankRows);
|
me.btnPivotBlankRows.updateHint(me.capBlankRows);
|
||||||
me.btnPivotSubtotals.updateHint(me.capSubtotals);
|
me.btnPivotSubtotals.updateHint(me.tipSubtotals);
|
||||||
me.btnPivotGrandTotals.updateHint(me.capGrandTotals);
|
me.btnPivotGrandTotals.updateHint(me.tipGrandTotals);
|
||||||
|
|
||||||
setEvents.call(me);
|
setEvents.call(me);
|
||||||
});
|
});
|
||||||
|
@ -266,6 +282,7 @@ define([
|
||||||
this.chColBanded.render(this.$el.find('#slot-chk-banded-column'));
|
this.chColBanded.render(this.$el.find('#slot-chk-banded-column'));
|
||||||
|
|
||||||
this.btnAddPivot.render(this.$el.find('#slot-btn-add-pivot'));
|
this.btnAddPivot.render(this.$el.find('#slot-btn-add-pivot'));
|
||||||
|
this.btnRefreshPivot.render(this.$el.find('#slot-btn-refresh-pivot'));
|
||||||
this.btnPivotLayout.render(this.$el.find('#slot-btn-pivot-report-layout'));
|
this.btnPivotLayout.render(this.$el.find('#slot-btn-pivot-report-layout'));
|
||||||
this.btnPivotBlankRows.render(this.$el.find('#slot-btn-pivot-blank-rows'));
|
this.btnPivotBlankRows.render(this.$el.find('#slot-btn-pivot-blank-rows'));
|
||||||
this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals'));
|
this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals'));
|
||||||
|
@ -314,8 +331,11 @@ define([
|
||||||
mniLayoutNoRepeat: 'Don\'t Repeat All Item Labels',
|
mniLayoutNoRepeat: 'Don\'t Repeat All Item Labels',
|
||||||
mniNoSubtotals: 'Don\'t Show Subtotals',
|
mniNoSubtotals: 'Don\'t Show Subtotals',
|
||||||
mniBottomSubtotals: 'Show all Subtotals at Bottom of Group',
|
mniBottomSubtotals: 'Show all Subtotals at Bottom of Group',
|
||||||
mniTopSubtotals: 'Show all Subtotals at Top of Group'
|
mniTopSubtotals: 'Show all Subtotals at Top of Group',
|
||||||
|
txtRefresh: 'Refresh',
|
||||||
|
tipRefresh: 'Update the information from data source',
|
||||||
|
tipGrandTotals: 'Show or hide grand totals',
|
||||||
|
tipSubtotals: 'Show or hide subtotals'
|
||||||
}
|
}
|
||||||
}()), SSE.Views.PivotTable || {}));
|
}()), SSE.Views.PivotTable || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue