question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom rendering of header cells

See original GitHub issue

I’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).

screenshot007

If there is no easy way to get around this i would try to implement a feature covering this for slickgrid.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
ckosmowskicommented, Jul 24, 2013

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.

2l506

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!

0reactions
mleibmancommented, Jul 24, 2013

😃

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found