Comments (9)
Ok, I'm looking at that example now. So obviously we're already providing pass in columns/data but you're asking about this other functionality. Soon as anything changes you can be notified (in this example, say, onFilteredChange triggers) and react to those changes and then pass in the newly changed state. Do I have that right?
filterable
defaultPageSize={10}
className="-striped -highlight"
// Controlled props
sorted={this.state.sorted}
page={this.state.page}
pageSize={this.state.pageSize}
expanded={this.state.expanded}
resized={this.state.resized}
filtered={this.state.filtered}
// Callbacks
onSortedChange={sorted => this.setState({ sorted })}
onPageChange={page => this.setState({ page })}
onPageSizeChange={(pageSize, page) =>
this.setState({ page, pageSize })}
onExpandedChange={expanded => this.setState({ expanded })}
onResizedChange={resized => this.setState({ resized })}
onFilteredChange={filtered => this.setState({ filtered })}
from mui-datatables.
@gregnb exactly
from mui-datatables.
@gregnb I realise this is where the idea for the callbacks onRowsSelected and oneRowsDelete come from. I was thinking instead of onRowsDelete, the function should be more generic and take in an svg. So something like onButtonClicked, and then when rows have been selected the button that pops up in the "x rows selected" div could be whatever material-ui icon the dev puts in along with the function (for example, sending all selected rows back to server to update/delete/whatever)
from mui-datatables.
Sorry, I'm trying to understand a little bit more of what you mean. Are you suggesting moving the local state data source that is inside of DataTable.js to an outside component so a user could do whatever they wish to that data set?
Sounds interesting just want to understand a little bit more
from mui-datatables.
Example from react-table.
Just add an ability to manage all state-management by user and pass it via props
from mui-datatables.
Sounds good to me, but before we start lets put together a list of which actions we're looking to have for props and finalize that list? BTW thanks for suggesting and even wanting to take this up! Pretty nice of you
from mui-datatables.
@gregnb BTW why you are not using react defaultProps
- it would be much more efficient from the rendering side. At all I have a lot of small refactoring suggestions. Where it would more convenient to place?
from mui-datatables.
Ok, let's try to separate the concerns. I've had some refactoring thoughts of my own as well. I would rank things in this order
- Server side pagination
- Refactoring
- Controlled component
As for the refactoring, if you knock out the server side pagination let's open up an issue and discuss what items you think are worth redoing. How about that?
from mui-datatables.
A lot of work has been done to add more support for SSR. If there are items still lacking open up new issues
from mui-datatables.
Related Issues (20)
- how to customize the inbuilt filter function to Cascading Dropdown
- custom filter, removed chip provide wrong `filterPos` when its value is 0 HOT 1
- An option to modify delete icon?
- Pagination Rows per Page resetting itself after clicking on custom button in column HOT 6
- Column Drag not working HOT 3
- in customHeadRender only 1 column needs to sort and not remaining elements HOT 1
- Link on github front page is malicious HOT 1
- Not wroking
- muidatatable scroll bar reset
- Not able to hide expander icon from specific rows
- Why are all the examples broken? HOT 1
- Print only appeared content rows with tableBodyMaxHeight applied
- Twitching while dragging columns
- Bad typing on MUIDataTableOptions renderExpandableRow - rowData
- Responsivenes Stacked not working
- setCellProps and setCellHeaderProps not working in mobile
- Customizing the contents of a chip label
- Cant search data with children having array of objects
- how to filter an date column by month
- States are not updating in customBodyRender
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-datatables.