0

jqgrid allows to sort columns using click in column header and set default sort order on load. sort icons are defined using

  $grid.jqGrid({
     viewsortcols : [false,'vertical',true],

Sort icon and direction is displayed after column caption. If column width is smaller that its caption, sort icon does not display.

There is no way to determine, is column sorted or not and sort direction.

How to fix this so that sorting order will also shown for small width columns? Is it possible to place sort icon before caption or use other way like underlining or color or bold font provide feedback to user for narrow columns also ?

Answer in how to undeline sorted column header in jqgrid shows how to use underlining or header background.

Answer in jqGrid, setting bg color on column cells when column header is clicked shows how to change column background on sorting.

Both answers use additional javascript and css styles.

Are those answers the way to go in free-jqgrid or is there better solution, e.q some builtin option ?

Community
  • 1
  • 1
Andrus
  • 26,339
  • 60
  • 204
  • 378

1 Answers1

1

Probably the usage of the option sortIconsBeforeText: true (see the answer) could be practical solution of your problem. The option exist starting with version 4.9.1 (see the readme). See the issue which was the origin of introduction the option.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798