Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / is there any way to apply display sort icons in javascript?

is there any way to apply display sort icons in javascript?

New Discussion
Annasaheb
Annasaheb asked on Dec 5, 2012 6:47 AM

I am not using remote sorting, Using local sorting & columnSorted event, I would like to retrieve custom sorted data and assign to the grid, I am able to achieve most of the requirements except to show correct icon next to column title (down arrow or uparrow), is there any way to achieve this?

Thanks

Sign In to post a reply

Replies

  • 0
    [Infragistics] Nikolay
    [Infragistics] Nikolay answered on Dec 3, 2012 11:55 AM

    Hi annasaheb,

    The sorting indicator icons are placed inside of a span in the grid headers. You could apply the following css classes to this span: .ui-icon and  .ui-icon-arrowthick-1-s (for down arrow) or .ui-icon-arrowthick-1-n (for up arrow). Here you can find a sample of igGrid local sorting – https://www.igniteui.com/grid/sorting-local.

    Hope this helps.

    • 0
      Annasaheb
      Annasaheb answered on Dec 4, 2012 11:05 PM

      Thanks, I had to write a code to get the table header and assign class to correct span. here is a code, may be useful for other coders.

      // set sortField & sortOrderDesc  before calling this routine.

      $("#dataGrid").data("igGrid").headersTable().find("thead tr th").each(function() {
          if (this.id.indexOf(sortField) != -1) {
              var sortClass = (sortOrderDesc) ? "ui-iggrid-colindicator-desc ui-icon ui-icon-arrowthick-1-s" : "ui-iggrid-colindicator-asc ui-icon ui-icon-arrowthick-1-n"
              $(this).find(".ui-iggrid-colindicator").addClass(sortClass);
          }
      }).end();

      • 0
        [Infragistics] Nikolay
        [Infragistics] Nikolay answered on Dec 5, 2012 6:47 AM

        Hi annasaheb,

        Thank you for sharing your code with the community.

        Let me know if you have further questions.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Annasaheb
Favorites
0
Replies
3
Created On
Dec 05, 2012
Last Post
13 years, 9 months ago

Suggested Discussions

Tags

Created by

Created on

Dec 5, 2012 6:47 AM

Last activity on

Feb 19, 2026 3:23 PM