Sorting (Angular) ICON icon not visible every time by default

Posted by: ksm.ac.in on 5 August 2020, 10:01 pm EST

    • Post Options:
    • Link

    Posted 5 August 2020, 10:01 pm EST - Updated 3 October 2022, 6:49 am EST

    Hello Team GrapeCity,

    The Ascending/Descending icon for sorting is not visible by default.

    Currently, It only appears on click of a column name.

    Requirement , this icon visible everytime with column/header name (no need it appear on click).

    For more see the attached image.

    Please provide require suggestion for it.

    Thanks in Advance

  • Posted 6 August 2020, 4:51 pm EST

    Hi,

    If you requirement is to sort the country column initially, then you can simply push a new SortDescription object to the CollectionView’s sortDescriptions array. This will sort the country column when the grid is loaded and the glyph will be displayed.

    grid.collectionView.sortDescriptions.push(new wjcCore.SortDescription('country', true));
    

    But, if you need to always display the sort icons and on each column, to inform the user that the headers can be sorted (or some other requirement), then you will need to use the formatItem event to add the sort glyphs and use CSS to customize them.

    Regards,

    Ashwin

  • Posted 6 August 2020, 4:52 pm EST

    Refer to the sample link below:

    https://stackblitz.com/edit/js-x4ngpq

  • Posted 6 August 2020, 4:57 pm EST

    Sorry, I mistakenly made the sample in JS. Here is the same sample in angular:

    https://stackblitz.com/edit/angular-ckv2ko

    ~regards

Need extra support?

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

Learn More

Forum Channels