How to sort and conditional format in a flatview table

Resolved
Bortolotti asked on November 29, 2016

I want to sort and put a conditional format in my flatview table, when the user open the report page.
The examples that I saw in this support doesn´t work for me. I don´t have biggest skill to do this.

My source code:
var Labels = {CONNECT: "Conectar"};
flexmonster.embedPivotComponent(
"flexmonster/",
"pivotContainer",
"100%",
"500",
{
dataSourceType: "ocsv",
filename: "http://localhost/to/pages/ajaxCarregaDados.php",
flatView: true,
showTotals: false,
showGrandTotals: false,
configuratorActive: false,
conditions: [{
   measure: "[Measures].[Probabilidade]",
   formula: 'if(#value > 1, "trueStyle")',
   trueStyle: {backgroundColor: red}
}],
rows: [{uniqueName: "Nome"}],
columns: [{uniqueName: "[Measures]"}],
measures: [
{uniqueName: "Probabilidade", sortName: "desc"},
{uniqueName: "%", type: "string"},
{uniqueName: "Idade", type: "number"},
{uniqueName: "Km", type: "number"},
{uniqueName: "Treinamento", type: "number"},
{uniqueName: "Data information", type: "number"}
],
licenseKey: "XXX"
},
false, // toolbar
Labels
);
 
Please, I need some help quickly.
 
Thanks!

2 answers

Public
Roman Petrusha Roman Petrusha Flexmonster December 1, 2016

Hi Bortolotti,
Here is a working sample for you https://s3.amazonaws.com/flexmonster/ambev/FLEXMONSTER-2016-AMBEV-DEC01.zip
Does it help?
 

Public
Bortolotti December 1, 2016

Almost there... The sort needs to be done in the "price" column and the "price" values are decimal or in my case, is a percentual number.
I will try your example and I will give you my feedback.
Thanks for now.

Please login or Register to Submit Answer