1

I got requirement to set column title per condition. No Grid method allows me to set column title after table gets rendered. I tried with setting new title via manipulating its value in options. But after that, I'll need to call refresh() method to show my new title. Because in the grid, I always have some columns hidden dynamically. Refresh() method will make these hidden columns showing again on the screen and I don't want it. So, is there a way to set new value to column title? Thanks.

Nick Yang
  • 60
  • 5

1 Answers1

0

For hiding individual columns, you can use the hideColumn, showColumn and isHidden methods.

You can also use the visible column property to set column visibility at initialization time.

There is no setTitle() method currently implemented, but you can email Shield UI's support and ask them to implement that for you. Depending on their load, they might do it real quick.

Until that is implemented, you can always update the title by using jQuery.

Vladimir Georgiev
  • 1,949
  • 23
  • 26
  • 1
    Thanks. In the end, I found out that I can use different column and pointing to the same path in the data source. Then give different title to these columns although they show same data. – Nick Yang May 22 '20 at 04:15
  • 1
    I used JQuery to replace column title at runtime earlier. It has below issues. 1. If you call refresh(), then original column title will come back to its column header, which is not what I want. 2. After you replace the title by using JQuery and you set sort to true, then you are not able to click title to trigger sorting. It just no response to your click. – Nick Yang May 23 '20 at 02:55