# loopback3-datatable

> Add count and data objects to model responses

Latest version **0.1.3** (published 2020-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install loopback3-datatable
pnpm add loopback3-datatable
yarn add loopback3-datatable
bun add loopback3-datatable
```

## 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.1.3 |
| Published | 2020-09-10 |
| First published | 2019-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thomas Vié |
| Maintainers | zeerobug |
| Keywords | loopback, mongodb, nodeJs, datatables |

## Links

- npm: https://www.npmjs.com/package/loopback3-datatable
- npm.io page: https://npm.io/package/loopback3-datatable

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2020-09-10
- 0.1.5 — 2020-04-03
- 0.1.4 — 2020-04-03
- 0.1.2 — 2019-04-19

## README

# loopback3-datatable

Returns all search results as needed by [datatables](https://datatables.net/), [vue-tables-2](https://www.npmjs.com/package/vue-tables-2) and other ajax based tables.
Data can be paginated, count result is the total of records corresponding to the filter, without pagination.
Compatible with [vue-tables-2](https://www.npmjs.com/package/vue-tables-2), for pagination and search queries. Reads from GET and POST data (untested). filerFields is an array of the searchable fields.
Example of query:
`filterFields[]=titre&query=Mark&limit=10&ascending=1&page=1&byColumn=0`

Derived from [loopback3-xTotalCount](https://github.com/zeerobug/loopback3-xTotalCount)

Response:

```json
  "response": {
    "data": [
      {"item_1": "val_1"}
      {"item_2": "val_2"}
      ...
      {"item_n": "val_n"}
    ],
    "count": "total_items"
  }

```

## Install

### NPM

1. `npm install loopback3-datatable`
2. Set the module in your `component-config.json` (loopback server endpoint)

```json
  "loopback3-datatable": {
    "pattern": [
      "*.find"
    ]
  }
```

## Options

### `pattern`: Array of String

Method patterns that will be modified.

Accepted patterns: See https://loopback.io/doc/en/lb3/Remote-hooks.html#wildcards.

Default value: `[ "*.find" ]`, which auto added to find method of all models.

## Known issues

no known issues

## License

This module is licensed under the [MIT Licence](LICENSE).

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