1.2.5 • Published 3 years ago

material_ui_react_laravel_table v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Material UI & Laravel DataTable

NPM JavaScript Style Guide

Install

npm install --save material_ui_react_laravel_table

Usage

Step 01(Import the plugin)

import { ReactMaterialUIGrid } from 'material_ui_react_laravel_table'
import 'material_ui_react_laravel_table/dist/index.css'
const axios = require('axios')

Step 02(Bring Data and store in the state)

const [users, setUsers] = React.useState(null)

axios
  .get('http://localhost:8000?page=' + page)
  .then(function (response) {
    setUsers(response.data)
  })
  .catch(function (error) {
    // handle error
    console.log(error)
  })

Step 03(Define Columns Headers)

const columns = [
  {
    field: 'id',
    headerName: 'ID',
    width: 70
  },
  {
    field: 'category_name',
    headerName: 'Category name',
    width: 130
  },
  {
    field: 'catalogue_sub_category_id',
    headerName: 'Sub-Category ID',
    width: 130
  },
  {
    field: 'category_image',
    headerName: 'Category Image',
    width: 130
  },
  {
    field: 'created_at',
    headerName: 'Created at',
    description: 'This column has a value getter and is not sortable.',
    sortable: false,
    width: 160
  },
  {
    field: 'fullName',
    headerName: 'Full name',
    description: 'This column has a value getter and is not sortable.',
    sortable: false,
    width: 160,
    renderCell: (params) => <strong>HTML</strong>
  }
]

Step 04(Component)

<ReactMaterialUIGrid
  columns={columns}
  data={users}
  options={{
    autoPageSize: false,
    autoHeight: true,
    pagination: {
      pagination: true,
      paginationMode: 'server'
    },
    components: {
      Toolbar: 'GridToolbar'
    },
    parentDivCSS: {
      width: '61.8%'
    }
  }}
/>

Sample Code

Github: https://github.com/sajidfrommerqata/material_ui_react_laravel_table

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.2.5

3 years ago

1.1.6

3 years ago

1.2.4

3 years ago

1.1.5

3 years ago

1.2.3

3 years ago

1.1.4

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago