我正在使用 Primefaces 3.4 并尝试使用单元内编辑导出数据表。它似乎不起作用。
我做了以下事情:
修改 org.primefaces.component.export.Exporter
第 143 行并添加:
else if (component instanceof CellEditor) { // Handle in-cell editable datatables
return exportValue(context, ((CellEditor) component).getFacet("output"));
}
这会导致在顶部多出一行,并在包含数据的实际单元格右侧多出一列。使用 Excel 文件没关系,因为它们不是“可见的”,但 PDF 看起来很糟糕。
- 有没有办法让 PF 3.4 在不更改源代码的情况下支持它?
- 如果对上述问题的回答是否定的,我能否生成 PDF 而无需额外的行/列?
最佳答案
Is there a way to make PF 3.4 support this without changing the source code?
没有。您必须提供自定义的 Exporter
实现/覆盖。我已经将其报告为 issue 4013几个月前。它不仅提到了 CellEditor
,还提到了 HtmlGraphicImage
(我们使用图像来显示 boolean 状态,我们希望以 PDF 格式显示其 alt
/XML/XLS/CSV 报告)。
您所能做的就是为它投票,这样它就有希望得到更多的关注,或者通过在 PF forum 上重新提问它。 .
If the answer to the above is negative, can I make the PDF get generated without the additional row/column?
您可以通过设置 exportable="false"
属性隐藏列的导出。
<p:column exportable="false">
关于java - Primefaces 3.4 dataexporter 不导出值 p :cellEditor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12705319/