DataTables / DataTables/Responsive

Bug: DataTable was not responsive on window resize

Open
#146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
151
Forks
91
PR merge metrics
No merged PRs in 30d

Description

DataTable was not responsive on window resize, my DataTable was broken after i migrated it from v1.13.0 to v2.1.8. you can see it on https://youtu.be/8x7ezmTDig8.

This happend because this commit remove resize.dtr event listener for conditionally set the column visibility when window resized

My current workaround in my project:

$(window).on(
    "resize.dtr",
    DataTable.util.throttle(function () {
        $(".dataTable").DataTable().responsive.recalc();
    }),
);

My suggestion was to re-add resize.dtr back to global event listenr

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing commit 500fd1bc64639e733ca3ebf72996c7d05069447d and the window resize path involving responsive.recalc(); compare it with the reporter’s resize.dtr workaround. Done means a DataTable migrated from v1.13.0 to v2.1.8 remains responsive and updates its column visibility after a window resize.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.