# ngbx-data-table

> ## Install the ng-bootstrap package in your project Run `npm install ng-bootstrap`

Latest version **0.0.7** (published 2019-04-04) · 0 weekly downloads

## Install

```sh
npm install ngbx-data-table
pnpm add ngbx-data-table
yarn add ngbx-data-table
bun add ngbx-data-table
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-04-04 |
| First published | 2019-03-03 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 84.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sudeep494 |

## Links

- npm: https://www.npmjs.com/package/ngbx-data-table
- npm.io page: https://npm.io/package/ngbx-data-table

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 0.0.7 (latest) — 2019-04-04
- 0.0.6 — 2019-03-04
- 0.0.5 — 2019-03-04
- 0.0.4 — 2019-03-04
- 0.0.3 — 2019-03-03
- 0.0.2 — 2019-03-03
- 0.0.1 — 2019-03-03

## README

# Get Started with NGBX-DATA-TABLE

## Install the ng-bootstrap package in your project
Run `npm install ng-bootstrap`

## Install the package
Run `npm install ngbx-data-table`

## Import the package
Run
`import { NgbxDataTableModule } from 'ngbx-data-table';`

Add Module to your module imports `NgbxDataTableModule`

## Demo
https://sudeep494.github.io/ngbx-data-table-demo/

## Use the Package - example

	<ngbx-data-table
		[documents]="documents"
		[columns]="columns"
		[limit] = "params.limit"
		[sortBy] = "params.sortBy"
		[order] = "params.order"
		count = "33"
		[templates] = "{'MoreInfoTemplate':MoreInfoTemplate,'PriceTemplate':PriceTemplate,'SellerTemplate':SellerTemplate}"
		(refetch)="onRefetch($event)">

	</ngbx-data-table>

	<ng-template #PriceTemplate let-document="document">
		$ {{document.Price}}
	</ng-template>



## Define your columns
```
columns = [
	{'name':'Name', 'label':'Product', 'sortable':true},
	{'name':'Price', 'label':'Price', 'sortable':true, template:'PriceTemplate', tooltip:'Plus Shipping'},
	{'name':'Color', 'label':'Color', 'sortable':false},
	{'name':'SellerCity', 'label':'Ships From', 'sortable':false, template:'SellerTemplate'},
	{'name':'ID', 'label':'More Info', 'sortable':false, template:'MoreInfoTemplate'}
];
```

## Define your params
```
params = {
	page : 1,
	limit: 5,
	sortBy: 'FirstName',
	order: 'asc'
}
```

##Fetch and Define your fetch handler

```
ngOnInit() {
	this.fetch();
}

fetch() {
	const fetchUrl = this.url+'?page='+this.params.page+'&limit='+this.params.limit+'&sortBy='+this.params.sortBy+'&order='+this.params.order;
	this.http.get(fetchUrl).subscribe(
		response => {
			this.documents = <any[]>(response);
			console.log(this.documents);
		}
	);
}

onRefetch(event) {
	this.params = event.params;
	this.fetch();
}
```

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