# syn-grids

> Data grid components.

Latest version **0.0.7** (published 2016-05-04) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install syn-grids
pnpm add syn-grids
yarn add syn-grids
bun add syn-grids
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2016-05-04 |
| First published | 2016-04-25 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Almeida |
| Maintainers | davidbarna |

## Links

- npm: https://www.npmjs.com/package/syn-grids
- Repository: https://github.com/soyundev/syn-grids
- Homepage: https://github.com/soyundev/syn-grids#readme
- Issues: https://github.com/soyundev/syn-grids/issues
- npm.io page: https://npm.io/package/syn-grids

## Dependencies (6)

- [jade](https://npm.io/package/jade.md) 1.11.0
- [jqlite](https://npm.io/package/jqlite.md) 0.2.34
- [lodash](https://npm.io/package/lodash.md) 4.6.1
- [bluebird](https://npm.io/package/bluebird.md) 3.3.4
- [syn-core](https://npm.io/package/syn-core.md) ~1
- [angular-bsfy](https://npm.io/package/angular-bsfy.md) 1.4.8

## Recent versions

- 0.0.7 (latest) — 2016-05-04
- 0.0.6 — 2016-05-04
- 0.0.5 — 2016-04-26
- 0.0.4 — 2016-04-25
- 0.0.3 — 2016-04-25
- 0.0.2 — 2016-04-25

## README

# syn-grids
Data grid components.

## Components

### syn-grid
Shows a grid base on inline json config.

#### options

| Name | Type | Description |
|------|------|-------------|
| cells | {Object} | Options of grid's cells |
| cells.foo | {Object} | Options options of the cells of `foo` property |
| cells.foo.filter | {Function} | A filter for the view. The function will be called and its result will be placed in the cell, instead of original value
| cells.foo.classes | {Array} | List of css classes to add to each cell of `foo` property |
| cells.foo.buttons | {Object} | List of buttons to add inside each cell of `foo` property |
| cells.foo.buttons[bar] | {Object} | Config for a button |
| cells.foo.buttons[bar].* | {Object} | Any of the mentioned options of `cells.foo` |
| cells.foo.on | {Object} | List of callbacks for events |
| cells.foo.on[eventName] | {Array, Function} | Call to call on event's triggering |
| head.foo | {Object} | Options options of the column |
| head.foo.label | {String} | Name of the column |
| head.foo.sort | {Boolean} | Wether column is sortable or not ( default: false ) |
| head.foo.* | {*} | Any option available in `cells`  |
| [pagination] | {Object} | Pagination config. Set to false to hide pagination |
| [pagination].buttons | {Number} | Number of page buttons to display ( default: 10 ) |
| [pagination].rowsPerPage | {Number} | Rows to display per page. ( default: 20 ) |
| [pagination].startPage | {Number} | First page to display ( default: 0 ) |
| [data] | {Object[]} | Data rows to display |

**Example of use:**

```html
<script>
$scope.gridConfig = {
  head: {
    name: { label: 'Name', sort: true },
    surname: { label: 'Last Name' }
  },
  cells: {
    name:
      filter: function(key, value, item) {
        return value + " (" + item.age + ")"
      }
  },
  pagination: false,
  data: [
    { name: 'David', surname: 'Smith', age: 46 }
    { name: 'Susan', surname: 'Collins', age: 34 }
    { name: 'Joe', surname: 'Johnson', age: 34, email: 'joe@gmail.com' }
  ]
}
</script>
<syn-grid options="gridConfig">
```
Output:

| Name  | Last Name |
|-------|:---------:|
| David (46) | Smith     |
| Susan (34) | Collins   |
| Joe (34)   | Johnson   |

>To see a demo of components, execute gulp serve command and open this url in >a browser: http://localhost:3000/docs/

---
_Source: https://npm.io/package/syn-grids · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
