[SSE] Get slicer style
This commit is contained in:
parent
0ba1760176
commit
15b036daf8
|
@ -8,7 +8,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="padding-large" id="sliceradv-checkbox-header"></div>
|
<div class="padding-large" id="sliceradv-checkbox-header"></div>
|
||||||
<div style="padding-bottom: 4px;"><label class="header"><%= scope.strStyle %></label></div>
|
<div style="padding-bottom: 4px;"><label class="header"><%= scope.strStyle %></label></div>
|
||||||
<div class="padding-large" id="sliceradv-combo-style" style="width: 100%;"></div>
|
<div class="padding-large">
|
||||||
|
<div id="sliceradv-btn-style" style="width: 100%;height: 52px;"></div>
|
||||||
|
</div>
|
||||||
<div style="padding-bottom: 4px;"><label class="header"><%= scope.strSize %></label></div>
|
<div style="padding-bottom: 4px;"><label class="header"><%= scope.strSize %></label></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="padding-large" style="display: inline-block; margin-right: 5px;">
|
<div class="padding-large" style="display: inline-block; margin-right: 5px;">
|
||||||
|
|
|
@ -103,23 +103,27 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem
|
||||||
}
|
}
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
this.cmbSlicerStyle = new Common.UI.ComboDataView({
|
this.btnSlicerStyle = new Common.UI.Button({
|
||||||
itemWidth: 50,
|
parentEl: $('#sliceradv-btn-style'),
|
||||||
itemHeight: 50,
|
cls : 'btn-large-dataview sheet-template-table',
|
||||||
menuMaxHeight: 272,
|
iconCls : 'icon-template-table',
|
||||||
enableKeyEvents: true,
|
menu : new Common.UI.Menu({
|
||||||
cls: 'combo-spark-style',
|
style: 'width: 400px;',
|
||||||
minWidth: 190
|
items: [
|
||||||
|
{ template: _.template('<div id="sliceradv-menu-style" class="menu-table-template" style="margin: 5px 5px 5px 10px;"></div>') }
|
||||||
|
]
|
||||||
|
})
|
||||||
});
|
});
|
||||||
this.cmbSlicerStyle.render($('#sliceradv-combo-style'));
|
this.mnuSlicerPicker = new Common.UI.DataView({
|
||||||
this.cmbSlicerStyle.openButton.menu.cmpEl.css({
|
el: $('#sliceradv-menu-style'),
|
||||||
'min-width': 178,
|
parentMenu: this.btnSlicerStyle.menu,
|
||||||
'max-width': 178
|
restoreHeight: 325,
|
||||||
});
|
groups: new Common.UI.DataViewGroupStore(),
|
||||||
this.cmbSlicerStyle.on('click', _.bind(this.onSelectSlicerStyle, this));
|
store: new Common.UI.DataViewStore(),
|
||||||
this.cmbSlicerStyle.openButton.menu.on('show:after', function () {
|
itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="46" width="61"></div>'),
|
||||||
me.cmbSlicerStyle.menuPicker.scroller.update({alwaysVisibleY: true});
|
style: 'max-height: 325px;'
|
||||||
});
|
});
|
||||||
|
this.mnuSlicerPicker.on('item:click', _.bind(this.onSelectSlicerStyle, this, this.btnSlicerStyle));
|
||||||
|
|
||||||
this.numWidth = new Common.UI.MetricSpinner({
|
this.numWidth = new Common.UI.MetricSpinner({
|
||||||
el: $('#sliceradv-spin-width'),
|
el: $('#sliceradv-spin-width'),
|
||||||
|
@ -388,6 +392,17 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem
|
||||||
this.lblSource.text(slicerprops.asc_getSourceName());
|
this.lblSource.text(slicerprops.asc_getSourceName());
|
||||||
this.lblFormula.text(slicerprops.asc_getNameInFormulas());
|
this.lblFormula.text(slicerprops.asc_getNameInFormulas());
|
||||||
|
|
||||||
|
value = slicerprops.asc_getStyle();
|
||||||
|
// var rec = this.mnuSlicerPicker.store.findWhere({type: value});
|
||||||
|
// if (!rec) {
|
||||||
|
// rec = this.mnuSlicerPicker.store.at(0);
|
||||||
|
// }
|
||||||
|
// this.btnSlicerStyle.suspendEvents();
|
||||||
|
// this.mnuSlicerPicker.selectRecord(rec, true);
|
||||||
|
// this.btnSlicerStyle.resumeEvents();
|
||||||
|
// this.$el.find('.icon-template-table').css({'background-image': 'url(' + rec.get("imageUrl") + ')', 'height': '48px', 'width': '63px', 'background-position': 'center', 'background-size': 'cover'});
|
||||||
|
this.$window.find('.icon-template-table').css({'height': '48px', 'width': '63px', 'background-position': 'center', 'background-size': 'cover'});
|
||||||
|
|
||||||
this._noApply = false;
|
this._noApply = false;
|
||||||
|
|
||||||
this._changedProps = slicerprops;
|
this._changedProps = slicerprops;
|
||||||
|
@ -406,6 +421,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
this.updateMetricUnit();
|
this.updateMetricUnit();
|
||||||
|
// this.onInitStyles(this.options.styles);
|
||||||
this._setDefaults(this._originalProps);
|
this._setDefaults(this._originalProps);
|
||||||
if (this.storageName) {
|
if (this.storageName) {
|
||||||
var value = Common.localStorage.getItem(this.storageName);
|
var value = Common.localStorage.getItem(this.storageName);
|
||||||
|
@ -413,11 +429,26 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onInitStyles: function(Templates){
|
||||||
|
var count = this.mnuSlicerPicker.store.length,
|
||||||
|
arr = [];
|
||||||
|
_.each(Templates, function(template){
|
||||||
|
arr.push({
|
||||||
|
id : Common.UI.getId(),
|
||||||
|
type : template.asc_getType(),
|
||||||
|
imageUrl : template.asc_getImage(),
|
||||||
|
allowSelected : true,
|
||||||
|
selected : false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.mnuSlicerPicker.store.reset(arr);
|
||||||
|
},
|
||||||
|
|
||||||
onSelectSlicerStyle: function(combo, record) {
|
onSelectSlicerStyle: function(combo, record) {
|
||||||
if (this._noApply) return;
|
if (this._noApply) return;
|
||||||
|
|
||||||
if (this._changedProps) {
|
if (this._changedProps) {
|
||||||
// this._changedProps.asc_setStyle(record.get('data'));
|
this._changedProps.asc_setStyle(record.get('type'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue