Order row by specific value and not by alphabetic order

HI


I am currently working with pivot table and I have a display problem that I can't fix. Each row used in my pivot table has a numeric value that allows me to know its position. Before passing my list to the table pivot, I order my list using this value. But once the generation is finished, the table sorts the rows in alphabetical order. Is it possible to keep the order of the list during the generation?


3 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team April 12, 2022 12:58 PM UTC


Hi Chaffois,


We believe that your requirement is related to custom sorting (i.e  user defined member sorting). If so, we would like to let inform that this feature will be included in our 2022 Volume 1 SP release which is estimated to be rolled out at mid of May. You can track the same by using the following link.

Feedback: https://www.syncfusion.com/feedback/18102/to-provide-custom-sorting-support


If this is different from your requirement, please share us more details with screen shot/video (if possible). So that we can work towards fulfilling your requirement.


Regards,

Angelin Faith Sheeba.



CQ Chaffois Quentin April 12, 2022 02:57 PM UTC

Hi

The request seems to correspond, so I will wait for the update to come out in order to verify that it is indeed the case. I will come back to you if the update does not match my request.


Thanks



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team May 16, 2022 09:51 AM UTC

Hi Chaffois,


We are glad to announce that our Essential Studio 2022 Volume 1 SP Release V20.1.0.55 is rolled out and the feature “Custom sorting” has been included in this release. Please refer to the following sample and code-snippet.


Code-snippet:

//Allows to specify the order in which the members should be sorted.

.SortSettings(sortsettings =>

{

    sortsettings.Name("Country").Order(Syncfusion.EJ2.PivotView.Sorting.Descending).MembersOrder(new string[] { "France", "United States" }).Add();

 

<script>

    function onHeaderSort(args) {

         //It triggers before the sorting performed, so you can perform custom sorting through this event.

        if (args.fieldName == 'Year') {

            args.members = ["Jan", "Feb"];

            args.IsOrderChanged = true;

        }

    }

</script>


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVCEJ22142438015


API Reference Link: https://ej2.syncfusion.com/javascript/documentation/api/pivotview/sortModel/#membersorder

https://ej2.syncfusion.com/javascript/documentation/api/pivotview/#onheaderssort


We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you require any further assistance.


Regards,

Angelin Faith Sheeba


Loader.
Up arrow icon