tasks = new Array();
var result = remote.call("/slingshot/dashlets/my-tasks");
var data = eval('(' + result + ')');
if (data.tasks !== null)
{
for (var i=0,len = data.tasks.length;i<len;i++)
{
tasks.push(data.tasks[i]);
}
}
j'obtiens une erreur:remote is undefined.tasks= workflow.assignedTasks
j'obtiens workflow is undefined.<webscript>
<shortname>Statistique</shortname>
<description>Statistique</description>
<family>dashlet</family>
<url>/shareextras/components/dashlets/statWorkflow</url>
</webscript>
statWorkflow.get.html.ftl<script type="text/javascript" src="${page.url.context}/org/shareextras/components/dashlets/statWorkflow.js"></script>
<script type="text/javascript" src="${page.url.context}/res/shareextras/components/dashlets/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
alert(tasks.length);
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column'
},
title: {
text: 'Statistique des tâches des workflows'
},
xAxis: {
categories: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre']
},
yAxis: {
min: 0,
title: {
text: 'Nombre des tâches des workflows'
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'right',
x: -100,
verticalAlign: 'top',
y: 20,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +'</b><br/>'+
this.series.name +': '+ this.y +'<br/>'+
'Total: '+ this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
}
}
},
series: [{
name: 'En attente',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}, {
name: 'En cours',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}, {
name: 'Terminée',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}]
});
});
});
</script>
<script src="${page.url.context}/res/shareextras/components/dashlets/highcharts.js"></script>
<script src="${page.url.context}/res/shareextras/components/dashlets/exporting.js"></script>
<div class="dashlet">
<div class="title">Statistique</div>
<div><span>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</span>
</div>
</div>
et statWorkflow.jstasks = new Array();
//tasks= workflow.assignedTasks
var result = remote.call("/slingshot/dashlets/my-tasks");
var data = eval('(' + result + ')');
if (data.tasks !== null)
{
for (var i=0,len = data.tasks.length;i<len;i++)
{
tasks.push(data.tasks[i]);
}
}
L'emplacement du fichier js etait sous workflowStat1\source\web\shareextras\components\dashlets ce qui est faux mais lorsque je tente de récupérer la variable tasks dans le ftl de cet façon,elle est undefini.Je crois que le lien est faux avec le js.Pouvez vous me corriger?Le code est juste un exemple(état brouillon).Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.