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

Change column header text dynamically #4430

Closed
Bv202 opened this Issue Sep 24, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@Bv202
Copy link

Bv202 commented Sep 24, 2015

Hey,

After the grid is already displayed, I would like to change the column header text. Is that any way possible?

@chris-allnutt

This comment has been minimized.

Copy link

chris-allnutt commented Sep 28, 2015

I maintain an array of my colDefs I used when I created my initial Grid, although not optimal you can update that collection and then call setColumnDefs again without reloading your data and it will reload the headers.

@PaulL1

This comment has been minimized.

Copy link
Contributor

PaulL1 commented Sep 28, 2015

You can probably change col.displayName (as opposed to colDef.displayName), which I think is bound so would automatically update.

@cjp666

This comment has been minimized.

Copy link

cjp666 commented Sep 30, 2015

You also need to call notifyDataChange(uiGridConstants.dataChange.COLUMN)

http://plnkr.co/edit/bhaTlq?p=preview

It is also covered in the documentation for adding / removing columns, see the button "Toggle Display Name"

http://ui-grid.info/docs/#/tutorial/113_adding_and_removing_columns

@Bv202

This comment has been minimized.

Copy link

Bv202 commented Oct 1, 2015

Thanks, I'll have a look at that!

@imbalind

This comment has been minimized.

Copy link
Collaborator

imbalind commented Nov 25, 2015

I'm closing this, for further Q&A question we suggest you use a website like Stack Overflow.

@imbalind imbalind closed this Nov 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment