Comments (20)
6.15.0 yes. 6.0.15 no.
from mui-x.
I've tried with the pro & premium packages, versions 6.15.0 and 6.16.1, and it's defined in both of them:
https://codesandbox.io/s/unruffled-snow-gvp55k?file=/src/demo.tsx
@andymanitara Can you provide a reproducible codesandbox example? It's not possible for us to understand what's wrong otherwise.
from mui-x.
@cherniavskii Why did you reopen this one? Did you notice the issue?
@andymanitara Was this issue resolved for you? Were you using the right package?
from mui-x.
I wanted to check if it's reproducible and also see how column autosizing works with asynchronously loaded rows.
from mui-x.
@andymanitara I cannot reproduce the issue with this demo: https://codesandbox.io/s/lucid-roentgen-ynchfy?file=/Demo.tsx
Are you sure you're passing the apiRef
prop to the data grid?
from mui-x.
@romgrk One thing I noticed in the example above is that calling apiRef.current.autosizeColumns
after updating the rows state doesn't work.
It makes sense - autosizeColumns
is being called before the grid renders the rows.
One workaround is to wrap autosizeColumns
with setTimeout
: https://codesandbox.io/s/sad-pasteur-cdyscq?file=/Demo.tsx
This works, but it's jumpy.
Another option is to use apiRef.current.updateRows
+ ReactDOM.flushSync
: https://codesandbox.io/s/interesting-ben-vh9ndk?file=/Demo.tsx
This works better than setTimeout
.
How would you approach this use case?
I think we should document a recommended approach since the use case is common and the solution is not obvious.
from mui-x.
Sure but maybe open a new issue just for that concern?
However, it tells me that autosizeColumns doesn't exist and when I log out the entirety of apiRef.current it doesn't exist as a property on the object.
My impression from this issue is that the author might have used the community package on which the autosizeColumns
API doesn't exist.
from mui-x.
Hey guys, yes I'm using the apiRef from the data grid, and I'm not using the community package. I'm using the DataGridPremium
also if that helps. I'm using a lot of the premium features, including the aggregation etc and that's working fine. For some reason though the apiRef doesn't have the autosizeColumns property still. Perhaps I should try with the DataGridPro
version instead and see if its happening there but not the Premium one for some reason?
I can't see how else I'm not getting that. I closed the issue because I ended up ignoring the autosizing feature for now, but it would be good to know. I see the autosize properties on the actual DataGridPremium component itself, just not in the apiRef & I'm definitely getting the useGridApiRef
from the premium package.
from mui-x.
from mui-x.
@andymanitara That sounds really weird. Are you able to reproduce the issue in a live example? This codesandbox.io template may be a good starting point.
from mui-x.
@andymanitara That sounds really weird. Are you able to reproduce the issue in a live example? This codesandbox.io template may be a good starting point.
https://codesandbox.io/s/distracted-ishizaka-mh8sv6?file=/demo.tsx
I'd expect to see the autosizeColumns property on click, in the console I assume? Or does it require something else? The type doesn't even exist on the GridApiPremium it says for me too. I had issues using the DEFAULT_GRID_AUTOSIZE_OPTIONS
too
from mui-x.
I noticed this as well after our package-lock lockfileVersion
changed from 2 -> 3. autosizeColumns
is visible on v2, but not 3 🤔
from mui-x.
Are you able to reproduce the issue in a live example? This codesandbox.io template may be a good starting point.
I think I just reproduced it.
EDIT: I just noticed the version "@mui/x-data-grid-premium": "6.0.3"
, so it's expected.
![](https://private-user-images.githubusercontent.com/13808724/272985736-763821c7-e9f8-4076-ad18-a6c64da1785a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQwNDk4OTcsIm5iZiI6MTcxNDA0OTU5NywicGF0aCI6Ii8xMzgwODcyNC8yNzI5ODU3MzYtNzYzODIxYzctZTlmOC00MDc2LWFkMTgtYTZjNjRkYTE3ODVhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDI1VDEyNTMxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5MDM1MTg2MmU3YWU0MGJjM2Y2OGZiNTlhYTkzZGY5NTQyN2Y4NzRjODRhZGNkNmJmZjZiMzc4NWIzNjY1Y2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.y-XI6WNagSTckMyN8jDnmYR687R2IOVTTOhQfcYIcLA)
from mui-x.
@andymanitara @charisseysabel Is this the same error you are experiencing?
Could you double-check which version of @mui/x-data-grid-premium
you are using?
from mui-x.
@andymanitara @charisseysabel Is this the same error you are experiencing?
Could you double-check which version of
@mui/x-data-grid-premium
you are using?
I'm using 6.0.15 of the @mui/x-data-grid-premium
from mui-x.
Is #10510 (comment) the same error you are experiencing?
Could you double-check which version of @mui/x-data-grid-premium you are using?
Yep, that's the error for me.
We're using the latest (v6.16.0) using data-grid-pro
from mui-x.
@andymanitara You need to use a version of the grid after the autosize feature was released. Can you test again with the latest version? Modifying your codesandbox to use @mui/[email protected]
fixes the issue for me.
from mui-x.
@romgrk 6.0.15 looks good, that was the first release to include column autosizing https://github.com/mui/mui-x/releases/tag/v6.15.0
from mui-x.
@romgrk 6.0.15 looks good, that was the first release to include column autosizing https://github.com/mui/mui-x/releases/tag/v6.15.0
That's a typo on my end here, I was using 6.15.0 sorry (as per my opening post) - I have the autosizing props working on the actual DataGrid itself it's just that apiRef.autosizeColumns that doesn't exist for some reason. I can try on 6.16.1 to see if it makes a difference but it should be fine on 6.15.0 and for some reason doesn't work for me still on that version
from mui-x.
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.
from mui-x.
Related Issues (20)
- [DataGridPremium] Consistent clipboard paste when multiple cells are selected
- [data grid] Sanitize cells with formulas for CSV export used in Excel HOT 2
- DateRangePicker not showing clear icon when the clearable slotProp is passed to the field HOT 1
- [pickers] Disable range modification on `DateRangeCalendar` when `selectionState === 'finish'` HOT 5
- [charts][docs] Document sparkline color modification
- [data grid] Popper is not overflowing footer HOT 8
- [pickers] Pressing Escape or clicking outside the picker will close it HOT 3
- [question] Is it possible to have background vertical lines for bar chart HOT 2
- [data grid] Data grids with multiple filterable column headings HOT 7
- [docs] Width of documentation table irritating small HOT 4
- [data grid] Trouble integrating DataGridPremium HOT 6
- [data grid] How can I style header filter row? HOT 6
- [data grid] client side filtering for number type is not working HOT 3
- [data grid] Broken calculation and display with `{ value: -1, label: 'All', }` pagesize option HOT 3
- [data grid] Checkbox selection is keeping selection when filtering HOT 5
- [pickers] DatePicker Placeholder HOT 2
- [data grid] How Can I get the filtered rows in the client side ? HOT 3
- [tree view] Changes made in TreeView are not instantly visible in the browser HOT 2
- How to change the color of the border between vertical and horizontal scroll of a DataGrid component?
- [data grid] How to keep column width after dynamic column update? HOT 2
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.