Does it support the sort of chinese in source data?
Hi!
Yes, it works with the Chinese language. You can find localization demo here: https://www.flexmonster.com/demos/js/localization/
Please keep in mind that UTF encoding is strongly required.
Thanks,
Roman
Hi Roman
Thanks for your answer. After checking the localication demo and switching to Chinese language, the word does not sort alphabetically when i click the descending button. The attachment below is the screenshot. The first column is the Cartagory
Regards
Leon
Leon,
Thank you for the quick response.
Could you please write a correct order of members because nobody understands Chinese in our team? So we need some help from your side.
Regards,
Roman
Hi Roman
You can try these steps below to reproduce the scenario.
1.click the link https://www.flexmonster.com/demos/js/localization/
2.click Chinese button to select the language
3.click options and in the layout panel, select flat form
you can see there are two columns which are category and total sum of price in the pivot table, the same as that in EN language.
In the category column, there are four members naming 服装、自行车、组件、配件 which are corresponding to clothing、Bikes、Components、Accessories. Surprisingly, there is a member nane '汽车' in chinese what's meaning car in EN,but it doesn't show in pivot table in EN Language and it does't mind.
when the sort is ascending, the right order is 服装、配件、汽车、组件、自行车
when the sort is descending,the right order is 自行车、组件、汽车、配件、服装
Does it make sence?
Regards
Leon
Hello Leon,
Thanks for the additional details. Our localization demo loads different files with data for English and Chinese localization. English file with data contains four members in the category column whereas Chinese file with data contains five members in the category column. As about sorting, our component sorts with the help of array.sort
JavaScript function. It compares member X
with member Y
the following way: X > Y
. Hence the sorting depends on your browser's implementation of JavaScript. We have checked, and 服装、汽车、组件、自行车、 配件 is the correct order for ascending sort in this case. We would like to add, that Google Sheets applies sorting just the same way. We suggest trying custom sorting to achieve the results you need (documentation about sorting). Please let us know if this solution is helpful.
Regards,
Tanya
Hi Tanya
How to get the trigger funciton when the sorting button in the row or column is clicked?
Regards
Leon
Hello Leon,
Thank you for writing. When you want to use the custom sorting order, there is no need apply it on sorting button press. You should just set the sorting order in the report when defining the pivot instance. Please have a look at the following example:
$("#pivotContainer").flexmonster({
"componentFolder": "",
"toolbar": true,
"report": {
"dataSource": {...},
"slice": {
"rows": [
{
"uniqueName": "Category",
"sortOrder": ["Bikes", "Cars", "Clothing",
"Accessories", "Components"]
}
],
"measures": [ {"uniqueName": "Price"} ]
}
}
});
If you want to achieve the other component's behavior, please provide us with some additional information about your case.
Let us know if you have more questions here.
Regards,
Dmytro.