hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

Add ability to use custom id instead of auto generated #245

Closed hjalmers closed 6 years ago

hjalmers commented 6 years ago

Example if the table data already contains a unique id for each record it should be possible to use it instead, this can be used to sync row state (open/selected etc.) when data is fetched from server.

hjalmers commented 6 years ago

Use rowIndex property of options to let the table now which column object key holds the unique id for the row. Eg.

{
 "rowIndex":"orderId"
}
orderId name
a1 lorem ipsum
b2 dolar sit amet
c3 consectetur adipiscing

Order id will in this case be used as a unique identifier for each row instead of an autogenerated one.