Hi all
I am testing pivotgrid component, but I am facing some issues and this component is not well documented :
- how to use i18n to set field names and column titles properly ?
- how to style column headers ? (just want to add some links and put background color)
- I want to style some cells with testing values which are not values of the cell, but parts of my json response : how to ? (only row and value parameters available)
thx a lot for your support
code example :
$('#pg').pivotgrid({
title:'Synthèse des participations délégataires à vos campagnes',
url:'${pageContext.request.contextPath}/rest/campagnes/tdb/',
method:'get',
pivot:{
rows:['relationActive','raisonSocialeDelegataire'],
columns:['libelleCampagneMere'],
values:[
{field:'inclus', op:'sum',
formatter:function(value,row,index){
if (value != null) {
if (value==1) return "<center><img align='center' title='" + i18n_messages["lib.yes"] + "' src='"+appContext+"/resources/img/ico_ok.png' width='16' height='16'/></center>";
if (value==0) return "";
if (value>1) return "<center>"+value+"</center>";
}
return "";
}}
]
},
i18n: {
columns: ['test1','test2']
},
frozenColumnTitle:'<span style="font-weight:bold">Mes délégataires / Campagnes</span>',
valuePrecision:0
})
}
example datas :
[
{
"libelleCampagneMere":"ddsdsq",
"idCampagneMere":31,
"raisonSocialeDelegataire":"test",
"relationActive":"Relations Actives",
"idDelegataire":1241,
"idCampagneDelegataire":0,
"score":-1,
"inclus":0,
"totalInclus":1,
"statutCampagneDelegataire":null,
"statutCampagneDelegant":"Clôturée"
},
{
"libelleCampagneMere":"dsqdsq",
"idCampagneMere":29,
"raisonSocialeDelegataire":"test",
"relationActive":"Relations Actives",
"idDelegataire":1241,
"idCampagneDelegataire":0,
"score":-1,
"inclus":0,
"totalInclus":1,
"statutCampagneDelegataire":null,
"statutCampagneDelegant":"Clôturée"
}
]