Skip to content

Columns should be able to access their complete row object #4

Locked Answered by shlomiassaf
tsiegleauq asked this question in Q&A
Discussion options

You must be logged in to vote

@tsiegleauq Thanks for using the grid!

Note that you have 2 options now, a declarative one using template and an imperative one using code and you already wrote them here:

<pbl-ngrid [dataSource]="myDS" [columns]="singleNameColumn">
    <div *pblNgridCellDef="'name'; value as value">
       {{ value.getFullName() }}
    </div>
</pbl-ngrid>
public textColumns = columnFactory()
  .table(
    { prop: 'identifier' },
    {
      prop: 'name',
      transform: (name, person: Person) => person
    }
  )
  .build();

IMHO there is no "best" here, you choose based on the thing you want to solve...
Some will find the template approach more easy and others might not.

Re-use is the key here, using te…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shlomiassaf
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
Converted from issue

This discussion was converted from issue #4 on December 21, 2020 23:48.