Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Sort column by click on header, not exactly on sort icon

Sort column by click on header, not exactly on sort icon

New Discussion
Andrew A
Andrew A asked on Jul 14, 2020 6:07 AM

As seen from the example below it’s possible – to sort column by click on row header, not on sort icon. It works even with commented

<ng-template igxHeader>.

https://stackblitz.com/edit/igx-grid-column-header-event-handling-issue-when-movable-dfwfyj?file=src/app/grid/grid-sample-pinning/grid-pinning.component.html

But I can’t figure out how to achieve this in my grid. Are there any special settings to sort column by click at any region of column header?

Sign In to post a reply

Replies

  • 0
    Martin Evtimov
    Martin Evtimov answered on Jul 13, 2020 2:08 PM

    Hello Andrew,

    Thank you for contacting Infragistics Community!

    A behavioral change in the way sorting is triggering on columns in the igxGrid’s was introduced with IgniteUI for Angular version 9.1 release.  From this version on, sorting is performed by clicking exclusively on the sorting indicator. In case the columns should be sorted via clicking on the entire header additional logic should be implemented. Please take a look at the following sample I have prepared for you. As you can observe, I have templated the headers and attached a pointerdown listeners (This event is suitable for the scenario when Moving feature is enabled. In case you are not using Moving feature the click of the header can be handled). Then in the onHeaderClick method I check if the column has been already sorted or not and I change the sorting direction accordingly.

    If this sample is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me for further investigation.

    Looking forward to hearing from you.

    Best Regards,
    Martin Evtimov
    Entry Level Software Developer
    Infragistics, Inc.

    • 0
      Andrew A
      Andrew A answered on Jul 13, 2020 2:48 PM

      Hello, Martin. The sample that you provided does exactly what I need.
      Your support is really awesome. Thank you.

      • 0
        Martin Evtimov
        Martin Evtimov answered on Jul 14, 2020 6:07 AM

        Hello Andrew,

        Thanks for your reply!

        I’m glad that you find the provided sample useful.

        Please let me know if there is anything else we can do for you.

        Best Regards,
        Martin Evtimov
        Entry Level Software Developer
        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Andrew A
Favorites
0
Replies
3
Created On
Jul 14, 2020
Last Post
5 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 14, 2020 6:07 AM

Last activity on

Feb 23, 2026 8:04 PM