Our blazing fast Grid component built with pure JavaScript


Post by Robert Hirst »

Hey guys, keep up the absolutely amazing work, I just have a quick one. I've got just one particular place in my app where the headers need to be light instead of dark, so I've defined a custom header renderer

headerRenderer : ({ column, headerElement }) => {
        headerElement.style.backgroundColor = 'white';
        headerElement.style.color = 'black';
        return 'Find by Name';
      }

Which is awesome that I can make that exception from the theme but I'm wondering is there any possible way to make a renderer for a selection cell header too, even though it's not defined in my columns?

Screenshot 2023-02-10 210023.png
Screenshot 2023-02-10 210023.png (40.89 KiB) Viewed 272 times

Post by mats »

Thanks for the kind words :) Yes you can do this easily, see the https://bryntum.com/products/grid/docs/api/Grid/view/mixin/GridSelection#config-selectionMode

Note checkbox config also takes a config object for its column:

Attachments
Screenshot 2023-02-11 at 08.34.05.png
Screenshot 2023-02-11 at 08.34.05.png (122.57 KiB) Viewed 261 times

Post by Robert Hirst »

Thanks Mats, I hadn't realised I could pass more than boolean there, that's exactly what I was after and it solves the issue perfectly.


Post Reply