We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pivot table numeric sorting

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


4 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team November 21, 2022 01:30 PM UTC

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.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team November 29, 2022 03:02 PM UTC

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.




AL Alex Lyashok November 30, 2022 03:11 PM UTC

i still get the same behavior - not sorting numerically:

https://dev.getmerit.xyz/fe/#mp-tab-admin-segments



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 1, 2022 12:18 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon