getHeaderTemplate is not a function when trying to apply headerTemplate to column

Uncaught TypeError: column.getHeaderTemplate(...) is not a function
at HeaderCellRenderer.prepareHeader (header-cell-renderer.js?03b5:162:1)
at HeaderCellRenderer.render (header-cell-renderer.js?03b5:59:1)
at _loop_1 (row-renderer.js?8246:96:1)
at RowRenderer.refreshRow (row-renderer.js?8246:128:1)
at RowRenderer.render (row-renderer.js?8246:34:1)
at HeaderRender.createHeaderContent (header-renderer.js?5625:347:1)
at HeaderRender.refreshUI (header-renderer.js?5625:634:1)
at Grid.refresh (grid.js?b311:2495:1)
at :1:11

This error appears when I try to set a header template on a column. It works fine as normal template but for the header it throws this error. What could be the problem


4 Replies 1 reply marked as answer

SG Sebastian Göhring April 13, 2022 04:39 PM UTC

Ok solved it by myself, you cant add headerTemplate after defining it in columns.


Marked as answer

RS Rajapandiyan Settu Syncfusion Team April 15, 2022 10:13 AM UTC

Hi Sebastian,


We are glad that you have resolved the reported problem by yourself.


Please get back to us if you need further assistance with us.


Regards,

Rajapandiyan S



AP Alejandro Perez May 2, 2024 10:26 AM UTC

Hello  Rajapandiyan Settu, how can you mark this as solved without providing a solution? 

This helps nothing to rest of us...



JS Johnson Soundararajan S Syncfusion Team May 3, 2024 09:19 AM UTC

Hi Alejandro Perez,


Sorry for the inconvenienced caused,


It seems there might have been a misunderstanding. Sebastian mentioned in his previous message that he resolved the issue himself by realizing that he couldn't add headerTemplate after defining it in columns. So, in a way, he shared the solution with us.


If you're still encountering a similar issue or require additional clarification, please refer to the documentation provided below for further details.


Documentation Link : Headers in EJ2 JavaScript Grid control | Syncfusion


Please get back to us, if you need further assistance.


Regards,

Johnson Soundararajan S


Loader.
Up arrow icon