Skip to content

Enhance sorter link rendering to include customizable sorter icons  #1010

@kartik-v

Description

@kartik-v
  • New property GridView::sorterIcons
  • New GridLinkSorter class to render sorter
  • Updated DataColumn class to render link based on GridView::sorterIcons

Description of GridView::sorterIcons:

    /**
     * @var array the configuration for sorter icons. The array key must have an `SORT_ASC` and
     * SORT_DESC entry. The `sorterIcons` property defaults to following if not overridden:
     * For Bootstrap 4.x and 5.x:
     * [
     *   SORT_ASC => '<i class="fas fa-sort-amount-down-alt"></i>',
     *   SORT_DESC => '<i class="fas fa-sort-amount-up"></i>'
     * ]
     * For Bootstrap 3.x:
     * [
     *   SORT_ASC => '<i class="glyphicon glyphicon-sort-by-attributes"></i>',
     *   SORT_DESC => '<i class="glyphicon glyphicon-sort-by-attributes-alt"></i>',
     * ]
     */
    public $sorterIcons = [];

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions