Ngx-datatable: Set default parameters to the datatable's properties for easy reuse in other components

Created on 4 Dec 2017  路  2Comments  路  Source: swimlane/ngx-datatable








I'm submitting a ...

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior
Use case: I use datatable in 5 components of my application. [limit] always equal 20 for all the table we use. Nevertheless I still have to specify _[limit]=20_ in my 5 html templates

Expected behavior
Is there a way to set default value to all the parameters of a ngx-datatable that will be used for each instantiation (limit, footerHeight, selectionType, etc.)?

Reproduction of the problem

What is the motivation / use case for changing the behavior?
Prevent from building a wrapper component around ngx-datatable to support default values.

Please tell us about your environment:

  • Table version: 10.4.0

  • Angular version: 4.4.6

  • Browser: [all]

  • Language: [TypeScript 2.6]

Most helpful comment

Any update on the above request?

All 2 comments

Any update on the above request?

It would be great if the settings would be globally set with .forRoot().

Was this page helpful?
0 / 5 - 0 ratings