M
M
MADSMILEXD2018-07-09 17:03:11
JavaScript
MADSMILEXD, 2018-07-09 17:03:11

How in the ngx-datatable (angular 5) module to insert your module into a table cell programmatically?

There is a table, ngx-datatable, the data is loaded into it in several stages, first the list of rows and columns is loaded, and then each row individually. The last column of the table should be a module with a chart, it was connected in the template as follows:

<my-app-user-charts [user_id]='1' [stat_by]='visits, views'> </my-app-user-charts>

How can I, after receiving all the data of a row, embed this module in the cell of this row, with the necessary parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
theykillimmortal, 2018-07-09
@MADSMILEXD

Hello. You can set any template for a cell. In the code below in ng-template you add your component. I hope this is the answer to your question.

<ngx-datatable-column prop="id">
       <ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
             <my-app-user-charts [user_id]=value [stat_by]='visits, views'> </my-app-user-charts>
      </ng-template>
</ngx-datatable-column>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question