Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing column heading text #117

Closed
PhouvanhKCSV opened this issue Sep 20, 2016 · 3 comments
Closed

Changing column heading text #117

PhouvanhKCSV opened this issue Sep 20, 2016 · 3 comments

Comments

@PhouvanhKCSV
Copy link

I've searching for the solution but could not found any, Could you please help me how can i change column heading text? Like i want to change column "Name" to "Fullname".

screen shot 2559-09-20 at 11 20 52 am

Thanks

@tabacitu
Copy link
Member

Hi @PhouvanhKCSV ,

In your entity's EntityCrudController, you've added the columns using $this->crud->addColumn(). Right? Well, if you specify "label" that will be the the column heading.

So:

$this->crud->addColumn([
   'name' => 'name', // The db column name
   'label' => "Fullname", // Table column heading
   'type' => 'text
]);

@PhouvanhKCSV
Copy link
Author

Thank you so much @tabacitu, it work!. Because i am using:

$this->crud->setFromDb();

and what i do now is to remove and re-add the columns, it would be better to have some function to modify the label.

@tabacitu
Copy link
Member

Hi @PhouvanhKCSV ,

Glad it worked for you. setFromDb() isn't at all a mature/complete functionality - it does display some columns and fields, but it's by no means "smart" right now. It will be in the future, but right now it's usually best to delete setFromDb() and specify the fields you like manually. At least that's how I prefer it.

Cheers!

This was referenced Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants