Sort Version numbers in sheet

Posted by: lokesh0809 on 19 September 2019, 4:23 am EST

  • Posted 19 September 2019, 4:23 am EST

    I would like to sort version numbers in my spreadsheet column. Currently it sorts the numbers as strings. For example:

    The number 1.2.3.4.19 should precede the number 1.2.3.4.20 but it places 1.2.3.4.20 before 1.2.3.4.19

    If I break the number in different arrays separated with “.” I can sort successfully but in that case it does not sort other columns.

    It looks like out of scope of SpreadJS, but I would need a custom solution for this. Please help!

  • Posted 20 September 2019, 5:52 am EST

    Hi Lokesh,

    We are sorry, we are unable to replicate the issue at our end with the WebDesigner and following demo sample:

    https://www.grapecity.com/demos/spread/JS/TutorialSample/Features/Slicer/slicerSetting/purejs

    Please share the demo sample or source code to set data in SpreadSheet.

    PS: Demo sample uses “12.2.5” version of Spread JS. Please try to upgrade to the latest build.

    Regards,

    Manish Gupta

  • Posted 20 September 2019, 7:18 am EST

    Do you see the sort working as per the requirement? I doubt!

    If a column has 1.2.3.4.9 and 1.2.3.4.10. On sorting in ascending order, do you see 1.2.3.4.10 after 1.2.3.4.9?

    If yes, could you please share the code with me?

    AFAIK, this is not normal sort behavior. I need a custom solution to perform this sort within SpreadJS.

  • Posted 23 September 2019, 5:02 am EST

    Hi Lokesh,

    We have escalated this case to the devTeam to confirm if is it possible to use custom sort compare function while sorting column. We will let you know as we get a response from the team. The internal tracking Id for the case is SJS-1777.

    Regards

    Sharad

  • Posted 30 September 2019, 1:12 pm EST

    It has been more than a week. Please let me know if we have any update on it.

  • Posted 1 October 2019, 12:07 am EST

    Hi Lokesh,

    We are sorry but currently, we do not support the custom sort functionality and hence we have added it to our backlog to implement this functionality in the future releases. We will let you know as soon as this is implemented.

    Regards

  • Posted 24 April 2020, 9:30 am EST

    Hi Lokesh,

    The support for custom sorting is now added in the latest version 13.1.0. Please refer to the following doc and demo for more info:

    • custom sorting: https://www.grapecity.com/spreadjs/docs/v13/online/custom-sorting.html

    • demo: https://www.grapecity.com/spreadjs/demos/features/worksheet/sort/purejs

    You may get the latest build from npm or download using the following link:

    http://cdn.grapecity.com/spreadjs/13.1.0/Files/SpreadJS.Release.13.1.0.zip

    Please update to the latest version and let us know you face any issues.

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels