JavaFX,如何冻结TableView中某些列的位置 [英] JavaFX, how to freeze the position of some columns in TableView

查看:1015
本文介绍了JavaFX,如何冻结TableView中某些列的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个想法是:在N列的TableView上,即使使用水平滚动条,前M列始终可见。

The idea is: on a TableView of N columns to have the first M columns always visible even when you use the horizontal scroller.

我的要求附近唯一的是将两个表视图绑定在一起,以便它们同步滚动
我认为并排两个表的想法不是最好的,因为

The only thing near my requirement is this Binding two tableviews together such that they scroll in sync. The idea to put side by side two tables is not the best by my point of view because

1)列的类型部分独立于两个表:如果你使用相同的observableList,行在两个表中排序,但不可能在多列上排序,其中至少有一列不在同一个表上

2)没有同步使用鼠标滚轮或箭头键滚动

1) The sort of the column is partially indipendent between the two tables: if you use the same observableList the rows are sorted in both tables but it is not possible the sort on multiple columns where at least one column is not on the same table
2) There is no syncronous scroll with the mouse wheel or with the arrows keys

我知道,我可以使用EventHandlers和Listeners处理这些问题,但我希望有可能只使用一个表。

I know that, probably, I can cope with problems like these using EventHandlers and Listeners but I am hoping it is possible to use only one table.

所以,问题是:TableView或TableColumns上是否有任何可配置属性可以实现我正在寻找的行为?

So, the question is: are there any configurable properties on TableView or TableColumns to have the behaviour I am looking for?

推荐答案


所以,问题是:TableView或TableColumns上是否有任何可配置属性可以提供我正在寻找的行为?

So, the question is: are there any configurable properties on TableView or TableColumns to have the behaviour I am looking for?

App原来没有,但是在JavaFX Jira上有一个关于这种行为的功能请求(你需要注册才能查看它):

Apparently not, but there is a feature request for this behavior on the JavaFX Jira (you'll need to register to view it):

https://javafx-jira.kenai.com/browse/RT-19454

我建议你投票。 :^)

I suggest you vote for it. :^)

这篇关于JavaFX,如何冻结TableView中某些列的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆