I am using datatable in my react project. How to rename the column title on performing some action?

I am using datatable in my react project. How to rename the column title on performing some action?

sivatsivat Posts: 2Questions: 1Answers: 0

Eg:

Initially my table has two columns as below:

Name age

After some action, I want to change the title as like this

Name. age < 20

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    You can use column().header() to get the node, which you can then change the text with:

      $(table.column(1).header()).text('this is now changed');
    

    Please see example here,

    Colin

  • sivatsivat Posts: 2Questions: 1Answers: 0

    Thanks a lot. It worked.

Sign In or Register to comment.