Richfaces DataTable 中行的扩展功能
我正在寻找一种方法来实现 Richfaces DataTable 行的扩展功能。用户将单击位于数据表第一列(每行)的“+”链接,该行将“展开”(意味着新文本将显示在当前行之间和下一个)。
我可以正常工作,唯一的问题是扩展视图中的所有信息都显示在该行的第一列部分中。我想做的是在整行中显示“扩展”文本(就好像“扩展”文本行不被列划分)。
有什么建议吗?我对 jsf/richfaces 有点陌生,因此任何示例代码将不胜感激。
I am looking for a way to implement a expand functionality to the rows of a Richfaces DataTable. The user would click a "+" link located in the first column (of each row) of the Datatable and the row would "expand" (meaning new text would be shown between the current row and the next).
I have that working, the only problem is that all the information in the expanded view is displayed in the first column section of that row. What I am trying to do is to show the "expanded" text in the whole row (as if the "expanded" text row is not divided by the columns).
Any suggestions? I'm a bit new at jsf/richfaces, so any sample code would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 rich:column 组件上的 breakBefore 属性来执行此操作。 RF 演示页面。
如果您在最后一列定义了 breakBefore 属性,那么它会为您工作。一个例子:
You can do this with the breakBefore attribute on the rich:column component. There is an example of its use on the RF demo page.
It would work for you if you had the last column define the breakBefore attribute. An example:
一种方法是使用 JQuery 功能。
演示链接 http://jsfiddle.net/BU28E/1/ 。
这里的一项额外开销是您需要检查 rich:dataTable 如何呈现为 Html 并为 jQuery 提供 DOM 模型。在 Richfaces 中拥有这样的功能有点棘手,并且需要一些复杂的解决方法。
One way for this is you can use the JQuery feature.
Demo link http://jsfiddle.net/BU28E/1/ .
One extra overhead here is you need to check how the rich:dataTable renders as Html and provide the DOM model for jQuery. It is bit tricky to have such feature in richfaces and it needs some complex workarounds.