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

How can i update the table value? #188

Closed jmblank09 closed 6 years ago

jmblank09 commented 6 years ago

My update is not reflecting on the table When i updated the data object in the configobject in the constructor.

screen shot 2018-01-28 at 2 15 32 pm screen shot 2018-01-28 at 2 15 48 pm
Crash1988 commented 6 years ago

Hi @jmblank09 , im not sure but you could try calling the table objet to redraw, in your class you can have a field like this: @ViewChild(GenericTableComponent) private myTable: GenericTableComponent<any, any>;

then after you update your data objet try calling redraw: this.myTable.redraw(); please let me know if that help you, again i am not sure , just trying to help...

jmblank09 commented 6 years ago

Thank you! It worked!

jmblank09 commented 6 years ago

Last question. Is It possible to change the width style of a specific column. Also, when i add a long text, the text is overlapping other column.

screen shot 2018-01-30 at 2 25 53 pm

Crash1988 commented 6 years ago

hi @jmblank09 i am sorry i have been very busy this week, you can add custom css using the special selectors for angular :hot ::ng-deep so lets say you have a colum with class description-colum

:host ::ng-deep tr >  td.description-column {
  width: 200px;
}

that should work, although i think there is a better way, just i haven check the documentation yet Thanks