[英]how to freeze any column of nattable without using any layers other than selection layer
I have added DragDetectListener
and run doCommand
in that. 我添加了
DragDetectListener
并在其中运行doCommand
。 It gives true result but column doesn't gets freeze. 它给出了真实的结果,但列没有冻结。 my code is :
我的代码是:
natTable.addDragDetectListener(new DragDetectListener() {
@Override
public void dragDetected(DragDetectEvent paramDragDetectEvent) {
boolean b = natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getcompositeFreezeLayer(), 0));
}
});
Adding code of layer stack : 添加层堆栈代码:
bodyDataLayer = new DataLayer(bodyDataProvider);
GlazedListsEventLayer<IzSearchResultRowData> glazedListsEventLayer = new GlazedListsEventLayer<IzSearchResultRowData>(bodyDataLayer, eventList);
bodyLayer = new DefaultBodyLayerStack(glazedListsEventLayer);
ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
bodyDataLayer.setConfigLabelAccumulator(bodyLabelAccumulator);
// Column header layer
selectionLayer = bodyLayer.getSelectionLayer();
DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(bulkDataManager);
columnHeaderDataLayer.setRowHeightByPosition(0, 35);
final FreezeLayer freezeLayer = new FreezeLayer(selectionLayer);
final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
freezeLayer, bodyLayer.getViewportLayer(), selectionLayer);
ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, compositeFreezeLayer, selectionLayer);
Another Thing : I am getting position coordinates through selection layer. 另一件事:我正在通过选择层获取位置坐标。 when i am running freeze command as natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getSelectionLayer(), 0));
当我将冻结命令作为natTable.doCommand(new FreezeColumnCommand(glazedListsGridLayer.getSelectionLayer(),0))运行时;
Its giving false result. 它给出错误的结果。
Hard to tell without seeing your layer stack. 很难看到您的图层堆栈。 Maybe you have a more complicated layer composition and the command is lost on the way because of the index-position-transformation.
也许您的图层组成更加复杂,并且由于index-position-transformation而使命令丢失。 Try to execute the command on the layer for which you provide the position coordinates.
尝试在为其提供位置坐标的图层上执行命令。
natTable.addDragDetectListener(new DragDetectListener() {
@Override
public void dragDetected(DragDetectEvent paramDragDetectEvent) {
boolean b = glazedListsGridLayer.getcompositeFreezeLayer().doCommand(
new FreezeColumnCommand(glazedListsGridLayer.getcompositeFreezeLayer(), 0));
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.