[WEB] deselect grid rows (delete action) and create control to save column display (in memory) - #47
[WEB] deselect grid rows (delete action) and create control to save column display (in memory)#47willferreiras wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Also, maybe would make sense to reduce localStorage reads from row 178 to row 193, to something like this:
const storagePageSize = localStorage.getItem(`${storageKey}-page-size`);
if () {
const parsedPageSize = parseInt(localStorage.getItem(`${storageKey}-page-size`) || '', 0);
setPageSize(parsedPageSize);
}
...
| .catch(); | ||
|
|
||
| localStorage.setItem(`${storageKey}-filters`, JSON.stringify({})); | ||
| setFilters({}); |
There was a problem hiding this comment.
why filters are being cleared on row deletion?
There was a problem hiding this comment.
The original bug is from MuiDataTable itself and this was the only way to fix it here on our side. If the user filtered by a situation (active for example) selected one or more records from the grid and deleted them, the grid would bug (it kept the selected records, but without listing the deleted ones because it was filtering by assets). Applying this change to clear filters when deleting a row resolved the issue.
| setPageSize(storagePageSize); | ||
| const storagePageSize = localStorage.getItem(`${storageKey}-page-size`); | ||
| if (storagePageSize) { | ||
| const parsedPageSize = parseInt(localStorage.getItem(`${storageKey}-page-size`) || '', 0); |
There was a problem hiding this comment.
| const parsedPageSize = parseInt(localStorage.getItem(`${storageKey}-page-size`) || '', 0); | |
| const parsedPageSize = parseInt(storagePageSize || '', 0); |
Apply to the others as well. please test it carefully
No description provided.