Code Monkey home page Code Monkey logo

Comments (2)

markmus avatar markmus commented on August 28, 2024

I also thinking if I could pass the whole data on a dataField, so that if I need two data on dataFormat.

Just like this one:

// Data
let datas = [
  name: "Jhon Doe",
  age: "24",
  birthdate: "01/01/1991",
  birthplace: "Metro City"
] 

// Formater
  @autobind
  actionFormatter(data, row) {
    return (
      <DropMenu iconButtonElement={ iconButtonElement}>
        <MenuItem primaryText='Birthday' value={ data.birthdate } />
        <MenuItem primaryText='Birthplace' value={ data.birthplace } />
      </DropMenu>
    )
  }

// Table
<BootstrapTable data={ datas }>
  <TableHeaderColumn dataField='name' isKey={ true }  dataSort={true} > Name</TableHeaderColumn>
  <TableHeaderColumn dataField='age' isKey={ true }  dataSort={true} > Age</TableHeaderColumn>
  <TableHeaderColumn dataField='all' dataFormat={ this.actionFormatter } isKey={ true }  dataSort={true} > Other Details </TableHeaderColumn>
  })
</BootstrapTable>

from react-bootstrap-table.

AllenFang avatar AllenFang commented on August 28, 2024

HI @markmus, about thread 1, your problem maybe like how display nest object(json) on this component, about this, I will spent some time to implement, cause of someone have the same questions before. And about thread 2, I think it's a good solution for you. So anything else or questions :)

from react-bootstrap-table.

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.