Refactoring table templates rendering

This commit is contained in:
Julia Radzhabova 2021-09-08 19:26:02 +03:00
parent 17521b6a47
commit e436fe3876
3 changed files with 16 additions and 1 deletions

View file

@ -240,6 +240,8 @@ define([
createDelayedControls: function() {
var me = this;
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'),
labelText: this.textHeader,
@ -729,6 +731,11 @@ define([
},
_onInitTemplates: function(Templates){
if (this._initSettings) {
this._tableTemplates = Templates;
return;
}
var self = this;
this._isTemplatesChanged = true;

View file

@ -227,6 +227,8 @@ define([
createDelayedControls: function() {
var me = this;
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'),
labelText: this.textHeader,
@ -670,6 +672,11 @@ define([
},
_onInitTemplates: function(Templates){
if (this._initSettings) {
this._tableTemplates = Templates;
return;
}
var self = this;
this._isTemplatesChanged = true;

View file

@ -685,7 +685,8 @@ define([
allowScrollbar: false,
groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getSparkGroupData()),
store: new Common.UI.DataViewStore(Common.define.chartData.getSparkData()),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>')
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>'),
delayRenderTips: true
});
});
this.btnSparkType.render($('#spark-button-type'));