DataTables / DataTables/NET

SearchPanes and SearchBuilder do not consider pre-filtering of the table.

Open
#11 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
19
Forks
11
PR merge metrics
No merged PRs in 30d

Description

When you apply a top level filter on a table, this is not taken into account by the options presented by SearchBuilderOptions or SearchPaneOptions.

Setup

Using the current example download for Editor. Showing this with SearchPanes because it is easier to see in the browser:

  1. Modify Controllers\SearchPanesController.cs to add a top level filter on site using the Where clause
var response = new Editor(db, "users")
    .Model<UploadManyModel>()
    .Where("site", "1", "=")
  1. Run the project and visit /examples/extensions/searchPanes.html
Result

The resulting table shows the correct data set:
image

However, the SearchPanes options still show the options from the full data set:
image

This includes the other options like Name:
image

Selecting one of the pre-filtered names results in zero records found, while the options show there should be one.

Expected behavior

Pre-filtered items are hidden from the SearchPane/SearchBuilder options.

This could result in data leaking, or weird results from logically deleted records.

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 with Controllers\SearchPanesController.cs and reproduce the issue at /examples/extensions/searchPanes.html using the documented site Where filter. Trace how SearchPanesOptions and SearchBuilderOptions are generated relative to the filtered table data. Done means both option sets exclude values hidden by the top-level filter, and the example no longer offers selections that return zero records.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.