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
104 stars 55 forks source link

render method not drawing dom element #140

Closed cdanyl closed 7 years ago

cdanyl commented 7 years ago

Hello! Using version "@angular-generic-table/core": "^4.6.0, i setting up my fields with a render method that return just a simple DOM element like a button.

{
   name: '',
   objectKey: 'action',
   render: () => '<button type="button" class="btn btn-outline-primary btn-sm">Edit</button>',
   value: () => '',
}

In my view, nothing appear to be rendered, the chrome inpector show me an empty span <span class="gt-row-content"></span>

I follow exactly the https://hjalmers.github.io/angular-generic-table/custom-columnexample.

any idea ?

cdanyl commented 7 years ago

I found :) the property data of GtConfig must be initialized with empty array

hjalmers commented 7 years ago

Yeah that’s true, should add it to docs or perhaps even better, change it so it would work without specifying an empty array.