Skip to content

[Bug/UX] Sorting icons should be hidden when there are no records in ngx-datatable #383

@dr-bharada

Description

@dr-bharada

Current Behavior

Record_2025-08-08-00-20-28.mp4

Currently, when the ngx-datatable has no rows (i.e. no data found), the table still displays the sorting indicators (˅, ˄) on the column headers.
This implies that sorting is possible even when there's no data, which leads to confusion for the end user.

Expected Behavior

When there are no records:

Sorting icons should not be shown.

Sorting click behavior should be disabled or ignored.

A clean header with no indicators would better match the “empty” state and improve UX.

Reproduction of the Issue

This issue can be seen directly in the official demo:
🔗 https://siemens.github.io/ngx-datatable/#/empty

When there are no rows, sorting icons still appear on column headers (e.g., Name, Gender).

Columns remain clickable even though there's no data to sort.

I'm not running ngx-datatable locally — this is observed in the official documentation/demo.

Version

24.1.0

What browsers are you seeing the problem on?

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions