Cannot get large strings to sort properly

Cannot get large strings to sort properly

smelchersmelcher Posts: 43Questions: 12Answers: 0

I have read several posts on how to get sorting to work with large strings, but I still cannot get it to sort properly.
Please see the fiddle below.
Fiddle: https://jsfiddle.net/2y6t5jx0/

Answers

  • kthorngrenkthorngren Posts: 21,077Questions: 26Answers: 4,906

    See this thread for an explanation. Updated test case prefixing leading zeros to make all the strings the same length:
    https://jsfiddle.net/rg6aq93n/

    Looks like it works.

    Kevin

  • smelchersmelcher Posts: 43Questions: 12Answers: 0

    I agree it now sorts, but I cannot have extra zeros in front. In my case, my data does not represent integers or numbers. They are strings. Is there not a way to force it to sort as string?

  • kthorngrenkthorngren Posts: 21,077Questions: 26Answers: 4,906

    The leading zeros are added to the sort operation as described in the orthogonal data docs. The display is not affected. You can remove the columns.render option if you don't want the leading zeros.

    Also note the test case has type set to string to force the column from type num to string. See the updated example's console:
    https://jsfiddle.net/hymt19pn/

    Kevin

  • smelchersmelcher Posts: 43Questions: 12Answers: 0

    Kevin,
    I believe "type" was what I was looking for. Thank you for helping me so quickly.
    Here is my fiddle:
    https://jsfiddle.net/81ah3bj2/1/

Sign In or Register to comment.