Coder Social home page Coder Social logo

Comments (9)

gregnb avatar gregnb commented on July 18, 2024 1

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.

dmtrKovalenko avatar dmtrKovalenko commented on July 18, 2024 1

@gregnb exactly

from mui-datatables.

JordanKadish avatar JordanKadish commented on July 18, 2024 1

@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.

gregnb avatar gregnb commented on July 18, 2024

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.

dmtrKovalenko avatar dmtrKovalenko commented on July 18, 2024

Example from react-table.
Just add an ability to manage all state-management by user and pass it via props

from mui-datatables.

gregnb avatar gregnb commented on July 18, 2024

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.

dmtrKovalenko avatar dmtrKovalenko commented on July 18, 2024

@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.

gregnb avatar gregnb commented on July 18, 2024

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

  1. Server side pagination
  2. Refactoring
  3. 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.

gregnb avatar gregnb commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.