|
[app.module.ts]
import 'syncfusion-ej-global/i18n/ej.culture.fr-FR.min.js';
|
|
[app.module.ts]
import 'syncfusion-ej-global/l10n/ej.localetexts.fr-FR.min.js';
|
|
[TS]
constructor() {
ej.Gantt.Locale["fr-FR"] = {
//headerText to be displayed in TreeGrid
columnHeaderTexts: {
taskId: "Tâche Ia",
taskName: "Tâche Tâche",
startDate: "Démarrer Date",
endDate: "Fin Date",
resourceInfo: "Resources",
duration: "Durée",
status: "Progrès",
predecessor: "Prédécesseur",
baselineStartDate: "Baseline Démarrer Date",
baselineEndDate: "Baseline Fin Date"
},
//string to display in dialog
editDialogTexts: {
addFormTitle: "Nouveau Tâche",
editFormTitle: "Modifier Tâche",
saveButton: "Sauver",
cancelButton: "Annuler"
},
}
|
|
[index.html]
<script type="text/x-jsrender" id="tooltipTemplate">
{{if #data.item['itemType'] == 'NE'}}
<table id="ne_tooltip">
<tr>
<td style="padding:3px; color:rgba(76, 175, 80, 0.69)"><b>Nidification</b></td>
</tr>
<tr>
<td style="padding:3px"><b>Début:</b> {{:~timeDisplay(startDate)}}</td>
</tr>
<tr>
<td style="padding:3px"><b>Fin:</b> {{:~timeDisplay(endDate)}}</td>
</tr>...
</script>
<script id="ViewTypeWc" type="text/x-jsrender">
<select id="dropdownContainer_wc">
<option value="wcm">Centres de travail</option>
<option value="opm">Les opérations</option>
</select>
</script>
[TS]
constructor() {
this.toolbarSettings = {
showToolbar: true,
customToolbarItems: [{
templateID: "#groupButtonsRefreshWc",
tooltipText: "Actualiser les données"
},
],
} |
|
//app.component.html
<ej-gantt id="GanttControl" [dataSource]="ganttData" taskbarTooltipTemplateId= "tooltipTemplateMX" >
</ej-gantt>
// Template codes for English culture
<script type="text/x-jsrender" id="tooltipTemplateES">
<table>
<tr>
<td style="padding:3px"><b>Start:</b></td>
<td style="padding:3px">{{:~timeDisplay(startDate)}}</td>
</tr>
<tr>
<td style="padding:3px"><b>End:</b></td>
<td style="padding:3px">{{:~timeDisplay(endDate)}}</td>
</tr>
</table>
</script>
// Template codes for Spanish culture
<script type="text/x-jsrender" id="tooltipTemplateMX">
<table>
<tr>
<td style="padding:3px"><b>comienzo:</b></td>
<td style="padding:3px">{{:~timeDisplay(startDate)}}</td>
</tr>
<tr>
<td style="padding:3px"><b>Fin:</b></td>
<td style="padding:3px">{{:~timeDisplay(endDate)}}</td>
</tr>
</table>
</script>
<select id="selMode" onchange="ChangedCulture">
<option value="1">"en-ES"</option>
<option value="2">"es-MX</option>
</select>
<script>
function ChangedCulture() {
var obj = $("#GanttControl").ejGantt("instance");
if (document.getElementById("selMode").value == 2) {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateMX";
obj.reRenderChart();
}
else {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateES";
obj.reRenderChart();
}
}
</script>
|
|
[index.html]
<script id="groupButtonsRefreshWc" type="text/x-jsrender">
<button>Refresh Data</button>
</script>
<div>
<select id="selMode" onchange="ChangedCulture()">
<option value="1">"en-US"</option>
<option value="2">"es-MX</option>
</select>
</div>
function ChangedCulture() {
var obj = $("#GanttControl").ejGantt("instance");
if (document.getElementById("selMode").value == 2) {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateMX";
obj.model.toolbarSettings.customToolbarItems[0].tooltipText = "Actualizar datos";
obj.setModel({ locale: "es-ES" });
}
else {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateES";
obj.model.toolbarSettings.customToolbarItems[0].tooltipText = "Refresh Data";
obj.setModel({ locale: "en-US" });
}
}
[TS]
constructor() {
this.toolbarSettings = {
showToolbar: true,
customToolbarItems: [{
templateID: "#groupButtonsRefreshWc",
tooltipText: "Refresh Data"
},
],
}
//..
}
|
|
//app.component.html
<ej-gantt id="GanttControl" [dataSource]="ganttData" taskbarTooltipTemplateId="tooltipTemplateMX" >
</ej-gantt>
[index.html]
// Template codes for English culture
<script type="text/x-jsrender" id="tooltipTemplateES">
<table>
<tr>
<td style="padding:3px"><b>Start:</b></td>
<td style="padding:3px">{{:~timeDisplay(startDate)}}</td>
</tr>
<tr>
<td style="padding:3px"><b>End:</b></td>
<td style="padding:3px">{{:~timeDisplay(endDate)}}</td>
</tr>
</table>
</script>
// Template codes for Spanish culture
<script type="text/x-jsrender" id="tooltipTemplateMX">
<table>
<tr>
<td style="padding:3px"><b>comienzo:</b></td>
<td style="padding:3px">{{:~timeDisplay(startDate)}}</td>
</tr>
<tr>
<td style="padding:3px"><b>Fin:</b></td>
<td style="padding:3px">{{:~timeDisplay(endDate)}}</td>
</tr>
</table>
</script>
<script id="groupButtonsRefreshWc" type="text/x-jsrender">
<button>Refresh Data</button>
</script>
<select id="selMode" onchange="ChangedCulture()">
<option value="1">"en-US"</option>
<option value="2">"es-MX</option>
</select>
function ChangedCulture() {
var obj = $("#GanttControl").ejGantt("instance");
if (document.getElementById("selMode").value == 2) {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateMX";
obj.model.toolbarSettings.customToolbarItems[0].tooltipText = "Actualizar datos";
obj.setModel({ locale: "es-ES" });
}
else {
obj.model.taskbarTooltipTemplateId = "tooltipTemplateES";
obj.model.toolbarSettings.customToolbarItems[0].tooltipText = "Refresh Data";
obj.setModel({ locale: "en-US" });
}
}
//app.module.ts
import 'syncfusion-ej-global/i18n/ej.culture.es-ES.min.js';
import 'syncfusion-ej-global/l10n/ej.localetexts.es-ES.min.js';
import 'syncfusion-ej-global/i18n/ej.culture.en-US.min.js';
import 'syncfusion-ej-global/l10n/ej.localetexts.en-US.min.js'; |