Grid 将边框设置为栅格(Vaadin 7.4.9)

Grid 将边框设置为栅格(Vaadin 7.4.9),grid,vaadin,Grid,Vaadin,我需要为网格中的列添加边框 在我的webapp中,我有addons.scss、mytheme.scss、styles.scss和styles.css。如何将新边框添加到网格中 我的网格代码- @凌驾 受保护的void init(VaadinRequest VaadinRequest){ 我的webapp文件夹中有一个类 Mytheme.scss // If you edit this file you need to compile the theme. See README.md for d

我需要为网格中的列添加边框

在我的webapp中,我有addons.scss、mytheme.scss、styles.scss和styles.css。如何将新边框添加到网格中

我的网格代码-

@凌驾 受保护的void init(VaadinRequest VaadinRequest){

我的webapp文件夹中有一个类

Mytheme.scss

// If you edit this file you need to compile the theme. See README.md for details.

// Global variable overrides. Must be declared before importing Valo.

// Defines the plaintext font size, weight and family. Font size affects general component sizing.
//$v-font-size: 16px;
//$v-font-weight: 300;
//$v-font-family: "Open Sans", sans-serif;

// Defines the border used by all components.
//$v-border: 1px solid (v-shade 0.7);
//$v-border-radius: 4px;

// Affects the color of some component elements, e.g Button, Panel title, etc
//$v-background-color: hsl(210, 0%, 98%);
// Affects the color of content areas, e.g  Panel and Window content, TextField input etc
//$v-app-background-color: $v-background-color;

// Affects the visual appearance of all components
//$v-gradient: v-linear 8%;
//$v-bevel-depth: 30%;
//$v-shadow-opacity: 5%;

// Defines colors for indicating status (focus, success, failure)
//$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically
//$v-friendly-color: #2c9720;
//$v-error-indicator-color: #ed473b;

// For more information, see: https://vaadin.com/book/-/page/themes.valo.html
// Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples

@import "../valo/valo.scss";

@mixin mytheme {

  @include valo;

.mytheme .v-grid-cell
{

    font-size: 5px;
    overflow: visible;

}

 //I insert this code here
.v-grid-cell.right-and-left-border {
 border-left: solid 2px black;
 border-right: solid 2px black;
 }

  // Insert your own theme rules here
}
有来自styles.scss的代码

@import "mytheme.scss";
@import "addons.scss";

// This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
// The actual styles should be defined in mytheme.scss

.mytheme {

  @include addons;
  @include mytheme;

}
这是类addons.scss

/* This file is automatically managed and will be overwritten from time to time. */
/* Do not manually edit this file. */

/* Import and include this mixin into your project theme to include the addon themes */
@mixin addons {
}
和styles.css有13000行

在将您的代码插入mytheme.scss并将网格集样式方法插入java代码之后,我重新编译了该项目

-- 现在我想更新我的主题中的一些样式

.mytheme .v-grid-row > td, .mytheme .v-grid-editor-cells > div {

    font-size: 15px;
    border-left: 1px solid #d4d4d4;
    border-bottom: 1px solid #d4d4d4;
}
我想要一些新的款式

.mytheme .v-grid-row > td, .mytheme .v-grid-editor-cells > div {
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    border-left: 1px solid #d4d4d4;
    border-bottom: 1px solid #d4d4d4;
}

我应该把它保存在哪里?再次感谢:)

@Shirkam你很接近事实。这就是这个问题的由来。他补充说,在他的应用程序中无法使用它,因为在他根据答案修改了源代码后,在视觉上没有任何变化。所以我建议打开一个新问题,提供所有细节levant的案例(代码、主题等)。不幸的是,这些详细信息丢失了…哦,那没关系,所以请@Ady96发布您的源代码,以便我们可以帮助您。您需要什么类型的源代码?.css或scss?或者?您是否调试了您的代码?它是否在
getStyle
中输入您的if?可能错误是使用了列agruptions而不是单列…不客气,我很高兴您这么做设法解决你的问题,请考虑花一些时间来发布你的解决方案,让其他有类似问题的人也能从中受益。@ Shirkam,你非常接近事实。这是这个问题起源的问题。他补充说不能在他的应用程序中使用它,因为他在修改T之后视觉上没有任何改变。他根据这个答案寻找信息来源。因此我建议提出一个新问题,提供与他的案例相关的所有细节(代码、主题等)。不幸的是,这些详细信息丢失了…哦,那没关系,所以请@Ady96发布您的源代码,以便我们可以帮助您。您需要什么类型的源代码?.css或scss?或者?您是否调试了您的代码?它是否在
getStyle
中输入您的if?可能错误是使用了列agruptions而不是单列…不客气,我很高兴您这么做设法解决您的问题,请考虑花一些时间来发布您的解决方案,以便其他类似问题的人也可以从中受益。
.mytheme .v-grid-row > td, .mytheme .v-grid-editor-cells > div {
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    border-left: 1px solid #d4d4d4;
    border-bottom: 1px solid #d4d4d4;
}