Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/features/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Configuration

Use `providedNgxDatatableConfig` to set defaults shared by all `ngx-datatable` instances in an application.
Register it during bootstrap:

```ts
import { bootstrapApplication } from '@angular/platform-browser';
import { providedNgxDatatableConfig } from '@siemens/ngx-datatable';

bootstrapApplication(AppComponent, {
providers: [
providedNgxDatatableConfig({
rowHeight: 48,
headerHeight: 48,
defaultColumnWidth: 200,
messages: {
emptyMessage: 'No results found',
totalMessage: 'results'
}
})
]
});
```

See the [NgxDatatableConfig API reference](../api/reference/ngx-datatable-config.md) for available configuration options.

## Per-table Overrides

Most properties can be overridden per table instance.
`messages` and `cssClasses` support partial overrides.
They are merged with the global configuration and the built-in defaults.

```html
<ngx-datatable [rows]="rows" [rowHeight]="64" [messages]="{ emptyMessage: 'No orders found' }">
...
</ngx-datatable>
```
4 changes: 3 additions & 1 deletion docs/introduction/features.md → docs/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The current features include:
- Decoupled theme'ing with included Google Material theme
- Light codebase / No external dependencies

See [Configuration](configuration.md) to configure shared defaults for all tables.

### Roadmap

We are really excited about the table and wanted to get it out into the open as quickly as
Expand All @@ -31,7 +33,7 @@ possible so we had to delay some of the features but we plan to add the followin
### Alternatives

This might not be the best fit for you given the above, there are some other great solutions
and some this project borrows from; heres a short list:
and some this project borrows from; here's a short list:

- [ng2-super-table](https://github.com/andyperlitch/ng2-super-table)
- [ng2-table](https://github.com/valor-software/ng2-table)
Expand Down
5 changes: 4 additions & 1 deletion zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ nav = [
{ "Introduction" = [
"index.md",
{ "Getting Started" = "introduction/getting-started.md" },
{ "Features" = "introduction/features.md" },
{ "Modes" = "introduction/column-modes.md" },
{ "Architecture" = "introduction/architecture.md" },
{ "Theming" = "introduction/themes.md" },
{ "Change Detection" = "introduction/cd.md" },
] },
{ "Features" = [
"features/index.md",
{ "Configuration" = "features/configuration.md" },
Comment thread
spike-rabbit marked this conversation as resolved.
] },
{ "API" = [
"api/index.md",
] },
Expand Down
Loading