06-18-2012 02:40 PM
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.06-19-2012 06:53 AM
06-19-2012 08:20 AM
<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).Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.