Comments (6)
@cherniavskii Thanks for the response, I thought that by adding hideable: false
it would force the column to always be shown, which was the opposite of what I'm looking for. I think with a combination of your example and adding slotProps with
columnsPanel: {
getTogglableColumns: (columns: GridColDef[]) =>
columns.filter((col) => col.hideable).map((col) => col.field),
},
I have a solution I'm happy with.
Thanks again 😄
from mui-x.
Hey @RhysOnlyBetter,
I will try to answer your questions 1 by 1.
-
Filter by id:
Since you have avalueGetter
function defined this is no longer possible, but you could change that to avalueFormatter
function which is being used for displaying the cell value (when exporting as well) -
Shadow col:
Yes, that would also be possible, by adding a filter function toslotProps.columnsPanel.getTogglableColumns
. Here is the related docs section: customize togglable columns
Important
The naming for that slotProp got changed in v7
v6
=> slotProps.columnsPanel.getTogglableColumns
v7
=> slotProps.columnsManagement.getTogglableColumns
That way you can hide the col from the panel.
Does that help you?
from mui-x.
Thanks for the response @michelengelen.
- Unfortunately
valueFormatter
won't work for me since I need to sort and use the quick filter based on the formatted value. - Thanks for the suggestion on
getTogglableColumns
, I'll add that to my original solution.
Do you think it would be a reasonable feature request to add an option to GridColDef
to shadow columns so this was a bit easier?
Thanks again for your help!
from mui-x.
IMO the approach with the method provides a lot more freedom and customizability.
WDYT @mui/xgrid ? would adding a property to the coldef make sense?
from mui-x.
I apply a valueGetter function to these to get the cell value I want to display (value) => thingValuesMap.get(value).name
This makes sense to me.
I'm now adding the ability to pass filters to my table component via queryParams, and need to filter by the raw thingId value.
How about adding a separate column and using columnVisibilityModel
to hide it?
Here is a working demo: https://stackblitz.com/edit/react-kms7xe?file=Demo.tsx,package.json
What do you think?
from mui-x.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.
How did we do @RhysOnlyBetter?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.
from mui-x.
Related Issues (20)
- [data grid] Providing InputComponentProps to valueInputProps in Filter Panel gives console warning due to props applying to all components in value column HOT 6
- [pickers] Date picker bug with disablePast HOT 4
- [data grid] Implementing Visual Feedback for Pasted Data HOT 3
- [charts] Support color scale
- [charts] Support color scale legend HOT 1
- [charts][docs-infra] Document interfaces in dedicated pages HOT 1
- [data grid] Full-featured CRUD not editing data retrieved from database HOT 3
- [data grid] How to handle nullable values for singleSelect columns? HOT 4
- With date-fns adapter, date picker date formatting for days of month < 10 always has zero padding, even when format specifies otherwise. HOT 2
- [data grid] position: absolute for rows to avoid repaint HOT 1
- [data grid] Incorrect class name rendered to GridToolbarQuickFilter when customized with GridToolbarContainer HOT 2
- [data grid] Time spend rendering Emotion/Pigment CSS HOT 2
- [pickers][DateTimePicker] not showing 2 in the hour category, but shows 3 twice and the first isn't selectable HOT 10
- [pickers] Date Picker style lost in prod env when loading `SEEK API` script HOT 1
- [datagrid] Performance: event-based reactivity
- [data grid] Use autocomplete in renderHeaderFilter HOT 1
- [data grid] useResizeContainer Console Error when wrapping <div> is modified HOT 1
- [pickers] How to remove leading 0 from TimePicker? HOT 3
- [data grid] Parameters needed for custom column resize. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mui-x.