1.0.20 • Published 3 years ago

fancygrid-react v1.0.20

Weekly downloads
15
License
Commercial
Repository
-
Last release
3 years ago

FancyGrid-React

A React Component for FancyGrid

Quickly create dynamic JavaScript grids that react when your data changes by utilizing the FancyGrid library and Facebook's React together.

Resources:

Quick Start

Install

npm install fancygrid-react

Usage

The FancyGrid-React Component exposes 3 components.

  • Grid
  • Form
  • Tab

Components

All components are wrappers around the entire widgets of FancyGrid.
The simplest one approach is to use config with widget options.

import {Grid, Fancy, Form, Tab} from 'fancygrid-react';

...
const getFancyGrid = () => {
  return (
    <div style={{marginTop: '5px'}}>
      <Form
        id={'myForm'}
        theme={'extra-gray'}
        title={'Form'}
        items={[{
          name: 'id',
          type: 'hidden'
        },{
          label: 'Name',
          emptyText: 'Name',
          name: 'name'
        },{
          label: 'SurName',
          emptyText: 'SurName',
          name: 'surname'
        }]}
        buttons={[{
          text: 'Save',
          handler: () => {
            let grid = Fancy.getGrid('myGrid'),
              form = Fancy.getForm('myForm'),
              values = form.get(),
              id = values.id;

            grid.setById(id, values);
            grid.update({
              type: 'row'
            });
          }
        }]}>
      </Form>
      <Grid
        id={'myGrid'}
        height={500}
        theme={'extra-gray'}
        exporter={true}
        selModel={{
          activeCell: true,
          type: 'rows'
        }}
        defaults={{
          resizable: true,
          menu: true
        }}
        events={[{
          selectrow: (grid, rowIndex, dataItem: any) => {
            let form = Fancy.getForm('myForm');

            form.set(dataItem.data);
          }
        }]}
        columns={getColumns()}
        data={getData()}>
      </Grid>
    </div>
  );
}
1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.11

3 years ago

1.0.12

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago