[ts]
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import { EJComponents } from 'ej-angular2';
import './GanttTemplate.js';
[js]
document.write('<script type="text/x-jsrender" id="taskbarTemplate">' +
'<div>'+
//..
'</div>'+
'</script>' ); |
document.write('<script type="text/x-jsrender" id="taskbarTemplate">' +
'<div class="e-gantt-template-taskbar bg-color" style="border-radius:5px;overflow:hidden;-webkit-transform:translateZ(0);-webkit-mask-image: -webkit-radial-gradient(circle, white, black);">'+
'<div>'+
'{{if #data["resourceNames"]}}'+
'<img style="position:relative;top:8px;left:4px;text-align:left;z-index:1;" height="32" width="32" src="./assets/gantt/{{:resourceNames}}.png" />'+
'<span class="tasknametext" style="position:absolute;z-index:1;font-size:14px;color:white;top:7px;left:40px;font-family:"Segoe UI";overflow:hidden;text-overflow:ellipsis;width:40%;">{{:#data["taskName"]}}</span>'+
'<span class="resourcenametext" style="position:absolute;z-index:1;font-size:12px;color:white;top:25px;left:40px;font-family:"Segoe UI";overflow:hidden;text-overflow:ellipsis;width:40%;opacity:0.5">{{:#data["resourceNames"]}}</span>'+
'<span class="progresstext" style="margin-top:22px;margin-right:4px;position:relative;float:right;color:white;z-index:1;font-family:"Segoe UI";font-size:14px;">{{:#data["status"]}}%</span>'+
'{{else}}'+
'<span style="margin:6px 14px 0 0;position:relative;float:right;color:white;z-index:1;">{{:#data["status"]}}%</span>'+
'{{/if}}'+
'</div>'+
'<div class="e-gantt-template-progressbar" style="font-size:13px;overflow:visible;">'+
'</div>'+
'</div>'+
'</script>'+
); |
“src="./assets/images/{{:statusName}}.png" |
constructor() {
this.renderTemplate();
}
renderTemplate(){
document.write('<script type="text/x-jsrender" id="taskbarTemplate">' +
'<div class="e-gantt-template-taskbar bg-color" style="border-radius:5px;overflow:hidden;-webkit-transform:translateZ(0);-webkit-mask-image: -webkit-radial-gradient(circle, white, black);">'+
'<div>'+ ///……
'</script>'
)} |