Custom rendering of header cells
See original GitHub issueI’d like to render the header cells of Slickgrid myself and the only way how i can do this at the moment is via the onHeaderCellRendered
callback. The problem here is, that slickgrid (as the name of the callback suggests) has already finished rendering the header cell.
So if i add something to the cell and it’s getting wider than before what happens is that the header cell will be as wide as i want it to be but the the table cells of that column will stay the same width as before.
grid.onHeaderCellRendered.subscribe(function(e, args){
//adding some stuff to args.node, setting the width of args.node to something wider via
//$(args.node).width(...);
});
And here’s how it looks. (green = correct width, red = old width).
If there is no easy way to get around this i would try to implement a feature covering this for slickgrid.
Issue Analytics
- State:
- Created 10 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
JTable column header custom renderer examples
This article shows how to create custom renderers for column headers in a JTable. Here's a couple of examples of JTable with its...
Read more >Custom HTML in cells and headers - Handsontable
Rendering custom HTML in cells. This example shows how to use custom cell renderers to display HTML content in a cell. This is...
Read more >Custom Rendering Row Headers - Handsontable Forum
I can see how to render custom HTML into column-headers: https://handsontable.com/docs/6.2.2/demo-custom-renderers.html#page-registering- ...
Read more >ag-Grid Header Rendering
DEPRECATED - Header Rendering As with the cell renderers, the header renderer is a function that takes params specific to the column. The...
Read more >How to render custom header in react-virtualized Table
Method to create a custom header by returning JSX; to be declared above the render method. You can return JSX, according to your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So what if i don’t need that option? I don’t want header cells to be truncated because making the columns that small will make the table contain less information because if you have a lot of columns rendered that way everything you see is “Bla…” in every header and every cell. And in addition to that you won’t even see how the table is sorted because the sort indicator is missing.
At this point i don’t think that this discussion will lead to anything constructive so it seems like i’ll have to take the beautiful features of github and fork my own. Let me at least close this with something humorous.
Please don’t get me wrong Slickgrid is a great piece of software. And again thank you for the great effort you’re putting into this!
😃
I still don’t get your point though. Since you specify column width manually anyway, just make it wider, no? If you know that your indicator adds 10px, you can make the changes to the column widths via grid.setColumns() from the plugin.