Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67411

Vaadin set background color for selected row in a grid

$
0
0

I'm new in vaadin development and i hope someone can help me. I just created a grid table with a model and everything works fine. But now, i want to change the background color of the selected row. I figure out, that i have to create a theme. I found this in the Vaadin Forum: https://vaadin.com/forum/thread/17867059/how-to-set-selected-row-opacity-in-vaadin-grid

This is what i have already done:

  1. I created a html class with the code from the link. I called this class grid-selection-theme.html
  2. I put this class into src/main/webapp/frontend/styles/grid-selection-theme.html
  3. In the java file with the Grid, i added the import: @HtmlImport("frontend://styles/grid-selection-theme.html);
  4. I added the theme to the grid: mygrid.addThemeName("grid-selection-theme");

Here is the code from the other thread in the forum:

<dom-module id="grid-header" theme-for="vaadin-grid">
  <template>
    <style>
        :host(:not([reordering])) [part~="row"][selected] [part~="body-cell"]:not([part~="details-cell"]) {
                background-color: rgba(255, 0, 0, .50);
        }
    </style>
  </template>
</dom-module>

But it does not work.


Viewing all articles
Browse latest Browse all 67411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>