DataTables / DataTables/Plugins

Conditional Paging Idea: Applying Plugin to Multiple Class-Based DataTables?

Open
#522 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

@mjhasbach : What needs to be done for ConditionalPaging to work with multiple tables all appearing on one page?

In my situation, I have multiple dynamically-populated tables appearing all together on one page. These are all initiated/configured for DataTables functionality using a single javascript function that's applied based on a class selector instead of an element id value.

When I apply the current version of this plug-in to a specific single table, it appears to work properly, but when multiple tables appear, one under the threshold and one over it, the plug-in seems to apply uniformly to all tables, based on the number of rows in the first one that it encounters.

I'm not certain how to do this without mucking up your plug-in. I'd appreciate your time and or a patch/fork that would address the situation, if you are able.

P.S. I'd also really love to be able to set a variable in the Conditional Formatting section that would, for each table, dynamically set the pagination row quantity threshold equal to the smallest value set for the length/pagination menus.

Contributor guide

Open the contributing guide

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 with features/conditionalPaging/dataTables.conditionalPaging.js and reproduce the issue using multiple dynamically populated tables initialized through a class selector. Check that each table determines its pagination behavior independently; the work is done when tables below and above the threshold no longer share the first table's result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.