我们可以在displaytag中使用rowspan和colspan吗? [英] can we use rowspan and colspan in displaytag?

查看:156
本文介绍了我们可以在displaytag中使用rowspan和colspan吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建一个表,其结构就是这样。

I have to create a table, whose structure is like this


|--------------------------------|  
|col1|col2|      col3       |col4|  
|    |    | col3.1 | col3.2 |    |  
|----|----|--------|--------|----|  
|----|----|--------|--------|----|  

可以使用display tag创建这样的datagrid吗?

Is it possible to create such a datagrid using display tag?

推荐答案

查看装饰器示例( http://displaytag.sourceforge .net / 1.2 / tut_decorators.html ),这是你最好的选择。

Check out the decorator examples (http://displaytag.sourceforge.net/1.2/tut_decorators.html), that is your best bet.

另一种方法是手动添加单元格的内容,像这样:

Another way to do it is to add the content of the cell manually, like so:

<display:column titleKey="something" media="html">

       <c:out_of_property_here>

</display:column>

如果我记得正确,如果我的表被定义如下:

If I remember correctly, if my table was defined like:

<display:table name="test" requestURI="some_uri"
    defaultsort="0" id="test" export="true" excludedParams="*" >

您将使用 test 访问当前元素,所以如果您正在显示的对象具有一个属性 id ,带有getter getId ,则可以访问当前对象该列表通过写入 test.id

you would access the current element using test, so if the object you are displaying has a property id with a getter getId, you would access the current object in the list by writing test.id.

但是我先尝试使用装饰器(您可以添加每列iirc装饰器),第二个选项是非常混乱的。

But I would try using a decorator first (you can add decorators per-column iirc), the second option is very messy.

这篇关于我们可以在displaytag中使用rowspan和colspan吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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