Concatenate two columns in list view
See original GitHub issueI would like to concatenate two columns in my list view. I want to have “firstname name”.
So i did an accesor in my model:
public function getFullNomAttribute() {
return $this->firstname . ' ' . $this->name;
}
And in my controller:
$this->crud->addColumn([
'label' => "concatened_name",
'type' => "model_function",
'function_name' => 'getFullNomAttribute',
]);
It’s working as long as i have the two columns defined with addColumn in my controller:
$this->crud->addColumn([
'name' => 'name',
'label' => "name",
'type' => 'text'
]);
$this->crud->addColumn([
'name' => 'firstname',
'label' => "firstname",
'type' => 'text'
]);
But i end up with three columns: firstname, name and concatened_name And if i remove the two addColumn my accesor is not working anymore… I want just concatened_name in my list.
Any idea ? Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (16 by maintainers)
Top Results From Across the Web
How to concatenate the values of two Columns into One ...
How to concatenate the values of two Columns into One inside ListView ; ListView Name="listView" ItemsSource="{Binding DeviceList}" SelectedItem= ...
Read more >How To Concatenate Columns In a SharePoint List ... - YouTube
This SharePoint tutorial will demonstrate how to concatenate two columns in a SharePoint list. Specifically, it will demonstrate how to ...
Read more >how to combine two list column values and show in another list
1. Create a List column with External Content Type. 2. Create another column based on external content type and concatenate State and City....
Read more >Pandas Concatenate Two Columns - Spark by {Examples}
In this article, I will cover the most used ways in my real-time projects to concatenate two or multiple columns of string/text type....
Read more >How to Concat Two Columns Into One With the Existing ...
In this article, we will see an SQL query to concatenate two-column into one with the existing column name. We can perform the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s what you can do to make your attribute show when enableAjaxTable() is present on your CRUD:
That’s it
It works!! Thank you @viktorivanov