-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Remove column id anywhere its not displayed #346
Comments
Not sure if this is the same issue, but I have my ID field configured like this:
And when you go to "Show Columns" (on any column header) it displays the ID in the Show All / Hide All menu with the switch disabled. But how do we not show it at all? The ID is required by the grid so we had to use it, but we don't want it to be displayed anywhere as it has no meaning to a user. Can this be done? |
@kodeschooler Could you open another issue? This one was only to hide the ID column in our demos. Regarding not displaying |
Ah. I will, sure, but now I'm a little more confused. I thought an ID column was required for the grid. Then I looked at the demos where you guys have an ID in the row data but don't have an ID column defined in the columns. So I just commented out my ID column and it doesn't throw an error about a missing ID. And, it actually produces the result I want- which is to not have ID show in the hide/show menu (because I'm not displaying it). Is ID only required in the rows data, but not in the columns? Or is it not required in either? Maybe I'm confusing it with something else and ID is not in fact required. If that's the case I don't really have an issue. I thought at one point recently I got an error about it missing. As far as not displaying hideable=false columns in filter panel, they don't. I just checked. |
It's not necessary to have an "ID" column in the |
Based on #342, we can simplify the demos of the documentation to not include the ID column if displayed hidden.
const columns: ColDef[] = [ - { field: 'id', hidden: true }, { field: 'firstName', headerName: 'First name', width: 130 }, { field: 'lastName', headerName: 'Last name', width: 130 },
For instance on the https://material-ui.com/components/data-grid/rendering/ page:
/~https://github.com/mui-org/material-ui-x/blob/6d23e1afb344d783727c484a41b5a8e1fd2cb5e1/docs/src/pages/components/data-grid/rendering/ValueGetterGrid.tsx#L5
The text was updated successfully, but these errors were encountered: