material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Errors in overriding components

Open aswamina opened this issue 7 years ago • 2 comments

  1. I tried to use the component override as follows : <MaterialTable components={{ Header: props => (
    ),

}}

Where do I import MTableHeader from ? I could not find this anywhere in my node_modules even though I have npm installed material-ui and material-table. 2) I tried to use component for Pagination as follows : <MaterialTable components={{ Header: props => ( <div style={{ backgroundColor: '#e8eaf5' }}> <TablePagination {...props} />

), }}

I imported TablePagination as : import TablePagination from "@material-ui/core/TablePagination";

It does not show my pagination in that color.

aswamina avatar Jan 09 '19 15:01 aswamina

You can import it as : import MaterialTable, { MTableHeader } from './material-table';

But you don't need it to give style. Try this:

<MaterialTable          
          columns={[
            { title: 'Adı', field: 'name'},
            { title: 'Soyadı', field: 'surname' },
            { title: 'Doğum Yılı', field: 'birthYear', type: 'numeric' },
            { title: 'Doğum Yeri', field: 'birthCity', lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' } }
          ]}
          data={this.state.data}
          title="Demo Title"
          options={{
            selection: true,
            filtering: true,
            headerStyle: {backgroundColor: 'black', color: 'white'}
          }}
        />

mbrn avatar Jan 09 '19 16:01 mbrn

I had a follow up question - is there a prop exposed for footerStyle, or pagination style? I would like to make my toolbar color and the footer color to be the same. Thanks for your help!

usahai avatar Jun 12 '20 01:06 usahai