gregnb / gregnb/mui-datatables

Search and filter functionality doesn't work if serverSide is true

Open
#1,037 5 comments 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

Hello, I'm currently having a problem with the data-tables because i want to use the search or the filter functionality as well as the serverSide one. In the past (about 2 months ago) both functionalities could work in parallel. Somehow today when i reviewed the system I'm working on, it doesn't work anymore.

## Expected Behavior
As I mentioned above, the search and filter functionality should work despite the serverSide functionality is active (as it did a couple months ago)

## Current Behavior
The search and filter functionality doesn't work if the serverSide functionality is active.

## Steps to Reproduce (for bugs)
1. It didn't work in my project so I thought i was my setup so what i did was copied the example from https://www.npmjs.com/package/mui-datatables with customisable columns
2. I ran the code on a local host and made sure that the search and filter functionality worked and they did.
3. I added the option serverSide: true
4. The search and filter functionality didn't work anymore

This is the example that I used:

const columns = [
{
name: "name",
label: "Name",
options: {
filter: true,
sort: true,
}
},
{
name: "company",
label: "Company",
options: {
filter: true,
sort: false,
}
},
{
name: "city",
label: "City",
options: {
filter: true,
sort: false,
}
},
{
name: "state",
label: "State",
options: {
filter: true,
sort: false,
}
},
];

const data = [
{ name: "Joe James", company: "Test Corp", city: "Yonkers", state: "NY" },
{ name: "John Walsh", company: "Test Corp", city: "Hartford", state: "CT" },
{ name: "Bob Herm", company: "Test Corp", city: "Tampa", state: "FL" },
{ name: "James Houston", company: "Test Corp", city: "Dallas", state: "TX" },
];

const options = {
filterType: 'checkbox',
serverSide: true,
};

## Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 4.5.1 |
| MUI-datatables | 2.12.4 |
| React | 16.9.0-alpha.0 |
| Chrome | 80 (newest) |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.