@methodexists/me-grid

0.1.0 • Public • Published

me-grid

Grid component to represent data handled by me-core.

Usage

Use <Grid /> component inside <ListProvider /> to present data from a model.

Minimal

<ListProvider
  namespace="users"
  table="users"
>
  <Grid
    routePath="/users"
    namespace="users"
    columns={[{
      keyPath: 'username',
    }, {
      keyPath: 'name',
    }]}
  />
</ListProvider>

Assumes that app state has schemas.users populated by Schemas model and lists.users populated by Lists model. <ListProvider /> does this job seamlessly.

API

<Grid /> props

Prop Type Default Description
*routePath string
*namespace string
*columns array
primaryKey string 'id'
showEdit bool true
showDelete bool false
afterDelete func(id) undefined Will be called after successfull delete. Deleted record id passed as a param
link func undefined
size string 'default'

columns props

Prop Type Description
*keyPath string
link bool
render func

Also supports Ant Design Table column props

Contributing

See CONTRIBUTING.md for how to develop a component.

Dependencies (0)

    Dev Dependencies (14)

    Package Sidebar

    Install

    npm i @methodexists/me-grid

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • ffab00
    • oluckyman
    • alexeyme