Skip to content

Concat Columns V 2.8 #907

Closed Answered by lrljoe
julianR92 asked this question in Q&A
Sep 9, 2022 · 4 comments · 5 replies
Discussion options

You must be logged in to vote

When you're using the following example:
Column::make('My one off column')
->label(
fn($row, Column $column) => $this->getSomeOtherValue($row, $column)
),
If you're using $this->getSomeOtherValue, then that needs to be a function that will return the data that you want to display. It can either be a function on the DataTable component (or a parent component).

If the function is in your model (for example), then you'd want to use $row->getSomeOtherValue() instead, passing the relevant parameters.

You can change getSomeOtherValue to whatever you choose to name your function.

As an example, in my TaskList table I have the following:

Column::make('Open Tasks')
->label(fn ($row) => $row->openT…

Replies: 4 comments 5 replies

Comment options

lrljoe
Sep 10, 2022
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

lrljoe
Sep 15, 2022
Collaborator Sponsor

You must be logged in to vote
5 replies
@julianR92
Comment options

@lrljoe
Comment options

lrljoe Sep 16, 2022
Collaborator Sponsor

@julianR92
Comment options

@lrljoe
Comment options

lrljoe Sep 16, 2022
Collaborator Sponsor

@julianR92
Comment options

Answer selected by julianR92
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants