@methodexists/me-grid

Grid component to represent data handled by me-core

Stats

StarsIssuesVersionUpdatedCreatedSize
@methodexists/me-grid
0.1.04 years ago4 years agoMinified + gzip package size for @methodexists/me-grid in KB

Readme

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.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.