Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
- Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected. e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'. Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model. Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps
本文地址:IT屋 » Virtual TableViewer sorting causes selection problems
我们的应用程序是RCP应用程序,需要显示数千项目的表格。因此,我们在 TableViewer 中使用 SWT.VIRTUAL 。
我们遇到以下问题:
- 我们的 TableViewer 支持排序和过滤。当我们使用虚拟表视图时,更改选择不会保留当前所选项,而是当前选择的行。这将导致另一项被选中。
例如:如果用户选择第5行出现的A”,执行排序,则在排序后排列第5行的项目而不是A”项。
使用非虚拟 TableViewer ,一切正常。
我们试图进行调试,发现来自 AbstractTableViewer.VirtualManager 类的缓存似乎是最新的模型。
强制缓存在 AbstractTableViewer.virtualSetSelectionToWidget()中使用可能是一种可能的方法。
我们已尝试实施 https://bugs.eclipse.org中建议的解决方案/bugs/show_bug.cgi?id=338696 。但是它没有起作用。
请建议一些指针或替代工作。
感谢您的答案
作为使用巨大表格的解决方法,我建议您查看Nattable项目 http://www.eclipse.org/nattable/ 。它支持您需要的一切(排序,过滤,树结构元素,延迟加载等)。我们成功地在我们的项目中使用它,在那里需要显示数十万个元素作为一个大约160列的树。它还有一些非常酷的造型功能,这可以使您的表更加用户友好和互动。希望这有助于
本文地址:IT屋 » 虚拟TableViewer排序导致选择问题
我们的应用程序是RCP应用程序,需要显示数千项目的表格。因此,我们在 TableViewer 中使用 SWT.VIRTUAL 。
我们遇到以下问题:
- 我们的 TableViewer 支持排序和过滤。当我们使用虚拟表视图时,更改选择不会保留当前所选项,而是当前选择的行。这将导致另一项被选中。
例如:如果用户选择第5行出现的“A”,执行排序,则在排序后排列第5行的项目而不是“A”项。
使用非虚拟 TableViewer ,一切正常。
我们试图进行调试,发现来自 AbstractTableViewer.VirtualManager 类的缓存似乎是最新的模型。
强制缓存在 AbstractTableViewer.virtualSetSelectionToWidget()中使用可能是一种可能的方法。
我们已尝试实施 https://bugs.eclipse.org中建议的解决方案/bugs/show_bug.cgi?id=338696 。但是它没有起作用。
请建议一些指针或替代工作。
感谢您的答案
作为使用巨大表格的解决方法,我建议您查看Nattable项目 http://www.eclipse.org/nattable/ 。它支持您需要的一切(排序,过滤,树结构元素,延迟加载等)。我们成功地在我们的项目中使用它,在那里需要显示数十万个元素作为一个大约160列的树。它还有一些非常酷的造型功能,这可以使您的表更加用户友好和互动。希望这有助于
本文地址:IT屋 » 虚拟TableViewer排序导致选择问题
Our application is an RCP appliction and needs to display table of several thousands items. For this reason, we're using SWT.VIRTUAL in our TableViewer. That works pretty well except for selection.
We're having following issue :
- Our TableViewer support sorting and filtering. When we use a virtual tableviewer, changing the selection does not preserve the current selected item but the row currently selected.This leads to another item being selected. e.g: If Item 'A' present at the 5th row is selected by user and sorting is performed, then after sorting the Item at the 5th row gets selected instead of the Item 'A'. Using a non virtual TableViewer, everything works fine.
We tried to go into debug and found out that the cache from the AbstractTableViewer.VirtualManager class seems to be up to date with the model. Forcing the cache to be used in the AbstractTableViewer.virtualSetSelectionToWidget() can be a possible approach.
We have tried to implement a solution suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=338696. However it didn't work.
Please suggest some pointers or alternative work around.
Thanks for the answers.
As a workaround for working with huge tables I would suggest you to take a look at the Nattable project http://www.eclipse.org/nattable/. It supports everything you need (sorting, filtering, tree structured elements, lazy loading etc.). We successfully use it in our project, where it is necessary to display hundreds of thousands elements as a tree with around 160 columns. It also has some pretty cool styling features, which can make your table more user-friendly and interactive. Hope this helps
本文地址:IT屋 » Virtual TableViewer sorting causes selection problems
