mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.14k stars 1.29k forks source link

[data grid] inconsistent rows with server side filterig #12426

Open bogdancbs opened 7 months ago

bogdancbs commented 7 months ago

Order ID or Support key πŸ’³

68255

Search keywords

server side filtering

Latest version

The problem in depth

If i have server side pagination , when I do server-side filtering, the results are not all gathered on one page, I find 1-2 on one page, then another 2 on another page, empty pages, etc. how do i solve this problem?

Your environment

`npx @mui/envinfo` ``` npx: installed 2 in 5.615s System: OS: Windows 11 10.0.22621 Binaries: Node: 14.21.3 - C:\Program Files\nodejs\node.EXE npm: 6.14.18 - C:\Program Files\nodejs\npm.CMD pnpm: Not Found Browsers: Chrome: 122.0.6261.112 Edge: Chromium (122.0.2365.80) npmPackages: @emotion/react: ^11.10.6 => 11.11.1 @emotion/styled: ^11.10.6 => 11.11.0 @mui/base: 5.0.0-beta.16 @mui/core-downloads-tracker: 5.14.10 @mui/icons-material: ^5.11.11 => 5.14.9 @mui/lab: ^5.0.0-alpha.133 => 5.0.0-alpha.145 @mui/material: ^5.14.0 => 5.14.10 @mui/private-theming: 5.14.10 @mui/styled-engine: 5.14.10 @mui/styled-engine-sc: ^5.11.11 => 5.14.10 @mui/styles: ^5.14.4 => 5.14.10 @mui/system: 5.14.10 @mui/types: 7.2.4 @mui/utils: 5.14.10 @mui/x-charts: ^6.0.0-alpha.6 => 6.0.0-alpha.12 @mui/x-data-grid: ^6.0.1 => 6.15.0 @mui/x-data-grid-pro: ^6.15.0 => 6.15.0 @mui/x-license-pro: 6.10.2 @mui/x-tree-view: 6.0.0-alpha.1 @types/react: 18.2.22 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 styled-components: ^5.3.9 => 5.3.11 ```
michelengelen commented 7 months ago

Please provide a minimal reproduction test case with the latest version. This would help a lot πŸ‘·.

A live example would be perfect. You can find a examples and guides on how to find templates in our docs with which you can provide examples for your specific use-case: Support - Bug reproduction.

Thank you! πŸ™‡πŸΌ

bogdancbs commented 7 months ago

Best example would be on your platform: https://mui.com/x/react-data-grid/pagination/#server-side-pagination

Filtre Comodity "S" you will see results on every page, the results shoud be all gathered on one page (or multiple based on rows per page) now you will see on your own example that the results are 1-2 on every page, this is wrong ...

cherniavskii commented 7 months ago

Best example would be on your platform: mui.com/x/react-data-grid/pagination/#server-side-pagination

Filtre Comodity "S" you will see results on every page, the results shoud be all gathered on one page (or multiple based on rows per page) now you will see on your own example that the results are 1-2 on every page, this is wrong ...

The linked demo showcases the server-side pagination, while the sorting and filtering are done on the client side. In the real world, when doing pagination on the server, you should handle the sorting and filtering on the server too. So the behavior in the demo is expected as it only covers the pagination part.

I think we should add a callout with this information in each server-side section (sorting, filtering, pagination). @michelengelen What do you think?

bogdancbs commented 7 months ago

@cherniavskii i agree with you, is as expected but i think this is not ok, you can check DataTable library, on server side filtering works as i described it, we are now on a crossroad ... with this project we need to change the DataGrid to server side so we can handle large data results and the client side dose not work for us so we need serverside, but DataGrid dose not cover the filtering correctly from our point of view. If you can resolve this it would be great, if not i am forced (by my employer) to search for another solution, and i don't want this.

cherniavskii commented 7 months ago

DataGrid dose not cover the filtering correctly from our point of view If you can resolve this it would be great

What is the setup you're looking for? Pagination, sorting, and filtering all working on the server side? If so, every feature has a server-side demo: pagination, sorting, filtering – you can apply them one by one and everything should work as expected.

I think it would make sense for us to prepare a demo that covers all 3 features. But nothing on the Data Grid side prevents you from using these features together.