1. <ec:table>里的属性还有: <ec:table cellspacing="0" cellpadding="0" border="0" width="80%" style="" styleClass="" />
<ec:table items="presidents" var="pres" action="${pageContext.request.contextPath}/presidents.run" > 3. <ec:row οnclick="" οnmοuseοver="" οnmοuseοut="" />
<ec:row style="" styleClass="" highlightClass="" />
提供可选取值方法的主要原因是使你能够对其他类型的html标签提供动作支持,例如显示 一幅图片或者通过定义href使该列成为到其它页的一个链接。 <ec:table items="presidents" var="pres" action="${pageContext.request.contextPath}/presidents.run" >
<ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" >
viewsAllowed属性制定类允许使用的视图。视图包括:html、pdf、xls、csv,以及任何定制的视图。 如果你指定一个或几个视图,那么列仅能使用这些指定的视图。例如:你指定viewsAllowed="pdf",这意味着 这列只允许PDF导出,而不能进行其他格式的导出或html视图。 <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" > <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" >
eXtremeTable能够指定是否处理所有的参数。默认为处理所有的参数,这意味着当你进行 过滤、排序、分页时,所有的参数都被eXtremeTable保存并传到JSP中。通常这是你需要的功能, 然而,有时候你需要只允许一些特定的参数保存到eXtremeTable中。我喜欢把它看作锁定extremeTable, 可以通过设置表的autoIncludeParameters属性值为false来到达目的: <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" autoIncludeParameters=”false” > <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" autoIncludeParameters=”false” >
为了替代硬编码eXtremeTable使用的默认属性值,我在属性文件中配置所有用到的属性。 如果你需要覆盖任何默认的设置,你可以创建自己的extremecomponents.properties文件 并设置你想改变的值。 为了设置属性文件,你应该如下例所示在/WEB-INF/web.xml文件中声明一个context-param,并 指定你的属性文件的路径: <context-param> <param-name>extremecomponentsPreferencesLocation</param-name> <param-value>/org/extremesite/resource/extremecomponents.properties</param-value></context-param> table.imagePath=/extremesite/images/*.gif
在属性文件定义的TableTag使用最多的两个属性是:imagePath和rowsDisplayed。如果你不在属性文件中声明 这些属性,你需要在每个eXtremeTable中添加他们。典型的表如下所示: <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" imagePath="${pageContext.request.contextPath}/images/*.gif" rowsDisplayed="12" title="Presidents" > ...</ec:table> <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" title="Presidents" > ...</ec:table>
<ec:column property="dateOfBirth" cell=”date” parse=”yyyy-MM-dd” format=”MM/dd/yyyy”/> <ec:column property="dateOfBirth" cell=”date”/> 下例为使用货币cell的典型列: <ec:column property="salary" cell=”currency” format=”$###,###,##0.00”/> <ec:column property="salary" cell=”currency”/> table.format.myCustomDate=yy-MM-dd <ec:column property="dateOfBirth" cell="date" format=”myCustomDate”>
11。ExportTag eXtremeTable具有导出不同格式文件的功能,导出的数据为过滤和排序后的所有结果集, 分页不会影响返回的结果集。换句话说,如果表数据分多页显示,那么所有页的数据都将被导出。 导出的格式为Microsoft Excel (OpenOffice Calc)、PDF和CSV。 使用ExportXlsTag导出Microsoft Excel (OpenOffice Calc): <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" /> <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" /> <ec:table items="presidents" action="${pageContext.request.contextPath}/presidents.run" /> |