- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在 Vaadin 中使用 Grid
表来表示数据。为此,我试图找出以下两个问题:
1.) 如何关闭每列表头的排序功能
2.) 如何设置Grid
表格中一列的颜色
最佳答案
首先,我找到了 Vaadin docs一个开始寻求帮助的好地方。对于练习的其余部分,假设我们有一个包含 3 个简单列 c1、c2 和 c3 的 Grid
:
Grid grid = new Grid();
grid.addColumn("c1", String.class);
grid.addColumn("c2", String.class);
grid.addColumn("c3", String.class);
1.) How to disable the sort function in the Header of each column
遍历每一列并将其可排序属性设置为false:
for (Grid.Column column : grid.getColumns()) {
column.setSortable(false);
}
或者只获取您想要的那一列并设置其可排序属性:
grid.getColumn("c1").setSortable(false);
2.) How to set the color of one column in a Grid table
类似于它的方式was done with the table ,您需要在 theme 中定义您的 CSS 样式:
@import "../valo/valo.scss";
@mixin mytheme {
@include valo;
// Insert your own theme rules here
.v-grid-cell.green {
background: #33BB00;
}
}
并使用 CellStyleGenerator将样式应用于所需的列:
grid.setCellStyleGenerator(new Grid.CellStyleGenerator() {
@Override
public String getStyle(Grid.CellReference cellReference) {
if ("c1".equals(cellReference.getPropertyId())) {
return "green";
} else {
return null;
}
}
});
应该生成如下内容:
关于java - Vaadin 网格表 : How to disable Sort Function and set the color of one column,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35602385/
我使用 jQuery 禁用选择下拉列表中的选项。我需要知道使用之间的区别 prop('disabled','disabled') 和 prop('disabled',true) 两者几乎都适用于所有浏
.attr('disabled', 'disabled') 和 .attr('disabled', true) 在我的代码中都有效,但我只是想知道:两者中哪一个更有效和/或哪一个更常用?真的有区别吗?
我的 asp.net mvc View 中有以下脚本:- function disableform(id) { $('#' + id).prop("disabled", true); } 但是
我已经在 Oracle VM Ware 中为我的 ubuntu 可信操作系统安装了 visual studio 代码和依赖项。我用这些命令运行代码。 ssh -X myserver code 但是当我
我有这个函数可以切换输入字段的禁用属性: $('.someElement').click(function(){ if (someCondition) { console.log
自从前几天我升级了 angularjs 后,我一直收到警告。每当我打开 ui.bootstrap 模式时,它都会发生。 这是我在 chrome-beta 44 中收到的警告: angular.js:1
我想限制用户在单击特定按钮时在文本框中输入值,否则设置禁用 false。如果我设置 $("#txtquery").attr("disabled","disabled"); 它将文本框设置为空白。如果切
How do I make a Spinner's "disabled" state look disabled? 可能重复. 我尝试了帖子中提到的解决方案,即 ((Spinner) spinner)
这段代码: $tds = $(this).closest('tr').find(td input,select); $tds.attr('disabled','disabled'); 使我的表格行不
使用 jQM 1.4.0我试图覆盖灰色样式(): input[type="text"]:disabled { opacity: 1.0 !important; color: black
不知道为什么这不起作用。 当人们单击我的应用程序的“编辑”按钮时,禁用的文本字段将变为可编辑: $("#bewerken").click(function(e) { $("input[d
我对以下差异有些困惑: swiftlint:disable:next swiftlint:disable:this 最佳答案 它们都用于禁用单行的快速规则。您还可以为单行启用规则。来自 SwiftLi
我看到一些代码 # pylint: disable=W0123 还有一些 # pylint: disable-msg=W0123 它们只是同义词吗? 最佳答案 从 pylint 0.21.0 开始不推
默认情况下,在桌面上,flutter 中的 btns 在禁用时会更改鼠标光标: 我们想禁用此行为,或替换为不同的光标。 最佳答案 要覆盖 ElevatedButton、TextButton 或 Out
我一直在学习很多关于标准 asp.net 验证器的知识,我的最新发现是关于如何禁用验证器客户端,这非常酷。 现在,如果我的初始帖子启用了验证器,但在客户端,我禁用它,服务器端是否识别客户端更改并保留它
默认情况下,在桌面上,flutter 中的 btns 在禁用时会更改鼠标光标: 我们想禁用此行为,或替换为不同的光标。 最佳答案 要覆盖 ElevatedButton、TextButton 或 Out
这个问题在这里已经有了答案: Should I use CSS :disabled pseudo-class or [disabled] attribute selector or is it a
我有一个 python 脚本,它发送包含文本、html 和 ics 附件的多部分电子邮件。这个想法是,现代电子邮件客户端将呈现 HTML 部分并提供将事件添加到用户日历中的功能。 代码如下: impo
我有一个最初被禁用的按钮: Lorem ipsum 对于此按钮,button.getAttribute('disabled') 返回 "disabled"。但是,当我使用 JavaScript 启用此
在我的一些测试中,我必须确认在设置某些标志时某些 select2 下拉菜单被禁用。为了证实这一点,我发现以下策略似乎有效: Assert.True(element.GetAttribute("disa
我是一名优秀的程序员,十分优秀!