Skip to content

Is it possible to filter and sort clr-datagrid, with specific API data setup #205

Answered by MckMaciek
MckMaciek asked this question in Q&A
Discussion options

You must be logged in to vote

I figured that out, so if someone had to do it this way, I guess it should be somewhat done the following way:
<clr-dg-column
*ngFor="let key of initial.columns"
clrDgField="row.{{initial.columns.indexOf(key)}}"
>
<div style=" text-transform: capitalize;">{{key.toLowerCase()}}</div>
</clr-dg-column>
<clr-dg-row
*clrDgItems="let rows of initial.rows"
[clrDgItem]="rows">
<clr-dg-cell *ngFor="let columnKey of initial.columns"> {{ rows.row[initial.columns.indexOf(columnKey)]}} </clr-dg-cell>
</clr-dg-row>
(I had to change the example a little bit to fit my needs)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kevinbuhmann
Comment options

Answer selected by MckMaciek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants