https://ej2.syncfusion.com/documentation/pivotview/sorting/#alphanumeric-sorting seems to not work? In preview tab it still shows product ids sorted alphanumerically vs numerically. Same happens with my own data -
, dataType: 'number'seems to not do anything
Hi Alex,
This is an known issue and is now resolved. Moreover, this issue fix will be available in our upcoming weekly release, which is scheduled to be released at November 29, 2022.
Regards,
Angelin Faith Sheeba.
Hi Alex,
We are glad to announce that our Essential Studio weekly release V20.3.59 is rolled out and fix for the reported issue has been included in this release. Please refer to the following sample.
Sample: https://stackblitz.com/edit/yxchly?file=index.js,index.html
Output screenshot:
Release notes: https://ej2.syncfusion.com/javascript/documentation/release-notes/20.3.59/?type=all#pivot-table
We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you require any further assistance.
i still get the same behavior - not sorting numerically:
Hi Alex,
We recommend using custom sorting, which allows you to sort field headers (aka, members) in rows and columns in a user-defined order. Please refer the below code example.
Code example:
|
var pivotObj = new ej.pivotview.PivotView({ dataSourceSettings: { sortSettings:[{ name : 'Country',order: 'Ascending', membersOrder:['25000-50000','50000-100000' ,'100000+']}] }, } |
Sample: https://stackblitz.com/edit/netcjn?file=index.js,index.html
Output screenshot:
If it differs from your requirement, you can perform your custom sorting operation in the onHeadersSort event. Please see the below UG document for more information on the "custom sorting" and “onHeadersSort” event.
Document:
custom sorting: https://ej2.syncfusion.com/javascript/documentation/pivotview/sorting/#custom-sorting
onHeadersSort: https://ej2.syncfusion.com/javascript/documentation/pivotview/sorting/#onheaderssort