-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[DataGrid] apiGridRef subscribeEvent is undefined #2904
Comments
Hi, @wesyao thanks for raising this. Can you please provide the codesabdox reproduction? You can use this template https://codesandbox.io/s/material-ui-issue-next-o7xkt as a starting point. A reason could be if you do not render the |
Hi @flaviendelangle , Running into this on my end too, here's a codesandbox: |
@TimOwe the If you have a pro-license, here is the fixed code : https://codesandbox.io/s/practical-benz-es6zs?file=/src/Demo.tsx |
Ah, gotcha. The structure of the docs I'm looking at confused me a bit, |
@TimOwe can you please link me the doc page you are talking about ? I can probably improve the formulation 👍 |
Sure, here |
I agree that this formulation for a code example that uses the |
Hey @flaviendelangle thanks for getting back. I might have been a bit confusing, but the "tutorial" link I posted above was a fork of the demo sandbox and I put in my own package versions to test if it worked. |
@wesyao do we agree that this example is not crashing ? https://codesandbox.io/s/material-demo-forked-7qrl7?file=/demo.tsx |
Ah, I get what you mean now, let me rebuild some of it out and I'll get back to you ASAP. Thanks much! |
@flaviendelangle, so it might be tough to replicate my component in any meaningful way that isn't different than the forked demo. I'll still continue on it, but was wondering if there were a couple things to look out for or was glanced over on the docs?
|
If your const WrappedXGrid = props => {
const isLoading = useFetchSomeData();
if (isLoading) {
return null;
}
return <XGrid {...props} />
} Then you will have the |
I'm closing this issue from lack of feedback |
@flaviendelangle I'm getting the same error and I have the premium datagrid license. Using this documentation |
Hi, Could you provide a working reproduction, this Codesandbox template might be a good starting point. |
@flaviendelangle This is how I'm using the row grouping here
|
Are you passing the |
@flaviendelangle yes I am |
Is your |
@flaviendelangle yes it seems that it's running before the 1st rendering of the grid. |
You will probably have to create a wrapper with only In most situations, you should not create the |
Could you share an example of a wrapper with only useKeepGroupedColumnsHidden and useGridApiRef? |
Could the team consider revisiting this? was forced to completely re-write my component just to hide the columns (because of the hook aspects mentioned above). |
I was just bitten by this, and hadn't passed |
I need help wth this too, I have wrapper on top of mui x grid, it have conditional statement that returns null, and above is the |
@michelengelen I'm adding you to the loop 🙏 |
This seems very clear to me: @alelthomas @samuelsycamore tagging you as well as this is clearly docs related. |
It does seem like the relevant doc is getting lost in the Advanced section. I don't love that header name—who decides what's truly "advanced" anyway? (If this is something that I need to rely on then I would probably think of it as a "basic" or "fundamental" feature, but those are also pretty arbitrary designations.) Is there a better place for the three "advanced" docs to live? |
The three pages under "Advanced" are about behavioral customization. How to plug into the grid system to add some custom behaviors (by calling API methods imperatively, by listening to events or by interacting with the grid's state) |
In that case, would it make sense to rename "Advanced" to something like "Behavior" or "Custom Behavior" as a first step towards making it easier to find? |
I would be in favor of going in this direction indeed, not sure what the exact wording should be |
@flaviendelangle I'll open a PR for that and we can get more feedback on the naming there 🤝 |
Duplicates
Latest version
Current behavior 😯
We're currently on
@material-ui/x-grid@4.0.0-alpha.37
(we're currently working on the v5 migration) and using the paid xgrid component.@material-ui/core@4.12.3
as well. I'm trying to subscribe to some table events for some additional logic. I've followed the tutorial, even forked my own to test and read the docs many times. It appears to be quite trivial, however I am getting an exception that is being throw with this set code:an error occurs and crashes react rendering:
subscribeEvent
is undefined and I cannot subscribe to a grid event. This causes an exception to be thrown. I haven't been able to find anyone talking about it on the issues as well as stackoverflow. Looking for some help here!Thanks in advance!
Expected behavior 🤔
I expect to be able to print out the params.
Steps to reproduce 🕹
Context 🔦
I am trying to use use
apiRef.current.subscribeEvent
to subscribe to some grid event changes.Your environment 🌎
`npx @mui/envinfo`
Order ID 💳 (optional)
idk right now
The text was updated successfully, but these errors were encountered: