-
Notifications
You must be signed in to change notification settings - Fork 934
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
Add a loading option #958
base: master
Are you sure you want to change the base?
Add a loading option #958
Conversation
ed615c7
to
9107a9a
Compare
The same can be accomplished (visually) by providing a loader (custom ect.) Right before Quick dirty example using the serverside pagination example, as an example. const loadingComponent = (
<div style={{position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)'}}>
<CircularProgress size={24} />
</div>
);
return (
<div style={{position:'relative'}}>
{isLoading && loadingComponent}
<MUIDataTable title={<Typography variant="title">
ACME Employee list
</Typography>
} data={data} columns={columns} options={options} />
</div>
); |
This isn't a feature that I think should be supported at this time. It has come up a few times (Eg: #361 & #466). It's easy enough to add this in and around the table without making it core functionality (see The library needs to leave out some things to keep it from becoming bloating and overcomplicated. When it comes to additional component rendering, I think it's best left to custom renders or author-provided functionality. |
@gabrielliwerant it would be helpful in your |
@anthonywebb Agreed, the examples provided are not the best. Would you have any interest in submitting something to enhance the example? I created an issue for this and linked it here. |
As opposed to what has being said in this thread. I think load state should be part of server-side data source support. +1 to get this implemented. Thanks for this awesome lib btw! |
I also want to have this feature added, I am trying to have a loading indicator appear in the center of table body, and while it is showing, all the actions (changing page, filters, search) should be disabled, there is currently no easy way to do this. |
This adds a loading option to the table. It defaults to false.
When true, it adds a loader on top of the current table.
This is to facilitate server-side data loading.