Skip to content

Is there any way to animate expanding row? #728

@phen0menon

Description

@phen0menon

Hi, I need to animate expanding row by slideDown animation. Is there any way to do it?

import React, { Component } from 'react';
import BootstrapTable from 'react-bootstrap-table-next';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';


const products = [
  { 'id': 'asd1', 'name': 'asd1', 'price': '1000' },
  { 'id': 'asdass', 'name': 'asd1', 'price': '1000' },
];

const columns = [{
  dataField: 'id',
  text: 'Product ID'
}, {
  dataField: 'name',
  text: 'Product Name'
}, {
  dataField: 'price',
  text: 'Product Price'
}];

const expandRow = {
  renderer: row => (
    <div>
      <p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
      <p>{row.name}</p>
      <p>expandRow.renderer callback will pass the origin row object to you</p>
    </div>
  ),
  onlyOneExpanding: true
}

export default class Table extends Component {
  render() {
    return(
      <BootstrapTable
        keyField='id'
        data={ products }
        columns={ columns }
        expandRow={ expandRow }
      />
    )
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions