`
yan578351314
  • 浏览: 168367 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ectable用法

阅读更多
eXtremeComponents 用法
http://www.blogjava.net/amigoxie/archive/2008/01/08/173526.html   这里也是介绍此标签的用法

Extreme Table 是ExtremeCompontents(Home Page:http://www.extremecomponents.org? )中一个功能强大 而又容易配置,扩展,自定义的Table 控件,其功能包括排序, 分页, 导出Excel, pdf和汇总。

2。基本配制:
1)首先下载发行包 http://sourceforge.net/projects/extremecomp;
2)将包内的extremecomponents.jar 文件拷贝到项目的 WEB-INF/lib 目录中
3)将 dist 目录中的 extremecomponents.tld 文件拷贝到tld/ 中
4)将 test 目录中的 test.jsp 文件拷贝到 webroot目录中 (测试用Demo)
5)将 images 文件夹拷贝到 webroot目录中
6)将 extremecomponents.css 拷贝到 webroot/css目录中
7)在/source/org/extremecomponents/table/core目录找到extremetable.properties文件,
把它复制到src/conf里面并进行修改(ExtremeTable支持在properties文件里方便的统一配置丰富的全局属性).


官方的war包中的test.jsp文件有需要修改的地方.
第一处<%@ taglib uri="/tld/extremecomponents.tld" prefix="ec" %>
为了显示中文还需要加入:
<%@page pageEncoding="gb2312"
contentType="text/html; charset=gb2312"%>

由于官方的测试文件非常基础.
下面扩展两个倒出文件的方法.
<ec:exportPdf
   fileName="output.pdf"
   tooltip="Export PDF"
   headerColor="black"
   headerBackgroundColor="#b6c2da"
   headerTitle="Presidents测试"/>
  
<ec:exportXls
fileName="test.xls"
tooltip="EXECL"
text="XLS"/>

直接添加在<table>标签范围内就好了.

最重要的是下面...需要在web.xml里加入些代码

<context-param>

          <param-name>extremecomponentsPreferencesLocation</param-name>

          <param-value>/extremetable.properties</param-value>

</context-param>
     
==============如果不写以下这些是无法导出文件的..^_^========
<filter>
<filter-name>eXtremeExport</filter-name>
<filter-class>org.extremecomponents.table.filter.ExportFilter</filter-class>
<init-param>   
<param-name>responseHeadersSetBeforeDoFilter</param-name>   
   <param-value>true</param-value> 
</init-param>   </filter> 
<filter-mapping>
<filter-name>eXtremeExport</filter-name>
<url-pattern>/*</url-pattern> 
</filter-mapping>

<%@ taglib uri="/tld/extremecomponents.tld" prefix="ec" %>
<%@page pageEncoding="gb2312"
contentType="text/html; charset=gb2312"%>
<html>

<head>
<title>eXtremeTest</title>

<style type="text/css">

.eXtremeTable {
margin: 0;
padding: 0;
}

.eXtremeTable select {
font-family: Verdana;
font-size: 9px;
border: solid 1px #EEE;
width: 75px;
}

.eXtremeTable .tableRegion {
border: 1px solid silver;
padding: 2px;
font-family:Verdana;
font-size: 10px;
margin-top: 7px;
}

.eXtremeTable .filter {
background-color: #efefef;
}

.eXtremeTable .filter input {
font-family: Verdana;
font-size: 10px;
width: 100%;
}

.eXtremeTable .filter select {
font-family: Verdana;
font-size: 9px;
border: solid 1px #EEE;
width: 100%;
}

.eXtremeTable .tableHeader {
background-color: #308dbb;
color: white;
font-family:Verdana;
font-size: 11px;
font-weight: bold;
text-align: left;
padding-right: 3px;
padding-left: 3px;
padding-top: 4;
padding-bottom: 4;
margin: 0;
border-right-style: solid;
border-right-width: 1px;
border-color: white;
}

.eXtremeTable .tableHeaderSort {
background-color: #3a95c2;
color: white;
font-family:Verdana;
font-size: 11px;
font-weight: bold;
text-align: left;
padding-right: 3px;
padding-left: 3px;
padding-top: 4;
padding-bottom: 4;
border-right-style: solid;
border-right-width: 1px;
border-color: white;
}

.eXtremeTable .odd a, .even a {
color: Black;
font-size: 10px;
}

.eXtremeTable .odd td, .eXtremeTable .even td {
padding-top: 2px;
padding-right: 3px;
padding-bottom: 2px;
padding-left: 3px;
vertical-align: middle;
font-family:Verdana;
font-size: 10px;
}

.eXtremeTable .odd {
background-color: #FFFFFF;
}

.eXtremeTable .even {
    background-color: #dfe4e8;
}

.eXtremeTable .highlight td {
color: black;
font-size: 10px;
padding-top: 2px;
padding-right: 3px;
padding-bottom: 2px;
padding-left: 3px;
vertical-align: middle;
background-color: #fdecae;
}

.eXtremeTable .highlight a, .highlight a {
color: black;
font-size: 10px;
}

.eXtremeTable .toolbar {
background-color: #F4F4F4;
font-family:Verdana;
font-size: 9px;
margin-right: 1px;
border-right: 1px solid silver;
border-left: 1px solid silver;
border-top: 1px solid silver;
border-bottom: 1px solid silver;
}

.eXtremeTable .toolbar td {
color: #444444;
padding: 0px 3px 0px 3px;
text-align:center;
}

.eXtremeTable .separator {
width: 7px;
}

.eXtremeTable .statusBar {
background-color: #F4F4F4;
font-family:Verdana;
font-size: 10px;
}

.eXtremeTable .filterButtons {
background-color: #efefef;
text-align: right;
}

.eXtremeTable .title {
color: #444444;
font-weight: bold;
font-family:Verdana;
font-size: 15px;
vertical-align: middle;
}

.eXtremeTable .title span {
margin-left: 7px;
}

.eXtremeTable .formButtons {
display: block;
margin-top: 10px;
margin-left: 5px;
}

.eXtremeTable .formButton {
cursor: pointer;
font-family:Verdana;
font-size:10px;
font-weight: bold;
background-color: #308dbb;
color: white;
margin-top: 5px;
border: outset 1px #333;
vertical-align: middle;
}

.eXtremeTable .tableTotal {
background-color: #FFFFFF;
border-top: solid 1px Silver; 
}

.eXtremeTable .tableTotalEmpty {
background-color: #FFFFFF; 
}

</style>

</head>

<% java.util.List presidents = new java.util.ArrayList(); %>

<% java.util.Map president = new java.util.HashMap(); %>
<% president.put("name", "George Washington"); %>
<% president.put("nickname", "Father of His Country"); %>
<% president.put("term", "1789-1797"); %>
<% presidents.add(president); %>

<% president = new java.util.HashMap(); %>
<% president.put("name", "John Adams"); %>
<% president.put("nickname", "Atlas of Independence"); %>
<% president.put("term", "1797-1801"); %>
<% presidents.add(president); %>

<% president = new java.util.HashMap(); %>
<% president.put("name", "Thomas Jefferson"); %>
<% president.put("nickname", "Man of the People, Sage of Monticello"); %>
<% president.put("term", "1801-09"); %>
<% presidents.add(president); %>

<% president = new java.util.HashMap(); %>
<% president.put("name", "James Madison"); %>
<% president.put("nickname", "Father of the Constitution"); %>
<% president.put("term", "1809-17"); %>
<% presidents.add(president); %>

<% president = new java.util.HashMap(); %>
<% president.put("name", "哈哈哈"); %>
<% president.put("nickname", "The Last Cocked Hat, Era-of-Good-Feelings President"); %>
<% president.put("term", "1817-25"); %>
<% presidents.add(president); %>

<% president = new java.util.HashMap(); %>
<% president.put("name", "John Adams"); %>
<% president.put("nickname", "Old Man Eloquent"); %>
<% president.put("term", "1825-29"); %>
<% presidents.add(president); %>

<% request.setAttribute("pres", presidents); %>

<body style="margin:25px;">

<p style="font-family: Verdana;font-size:14px;">
Congratulations!! You have successfully configured eXtremeTable!
</p>

<br>

<ec:table 
items="pres"
action="${pageContext.request.contextPath}/test.jsp"
imagePath="${pageContext.request.contextPath}/images/table/*.gif"
title="Presidents"
width="60%"
rowsDisplayed="5"

>
<ec:exportPdf 
   fileName="output.pdf" 
   tooltip="Export PDF" 
   headerColor="black" 
   headerBackgroundColor="#b6c2da" 
   headerTitle="Presidents测试"/>
   
<ec:exportXls 
fileName="test.xls"
tooltip="EXECL"
text="XLS"/>


   <ec:row highlightRow="true">
<ec:column property="name"/>
<ec:column property="nickname"/>
<ec:column property="term"/>
</ec:row>

</ec:table>

<br>

<p style="font-family:Verdana;font-size:12px">

Below is the code that generates the above display. 

</p>

<pre class="bodyText" style="background-color:#eee;padding:2px;width:60%;font-family: Verdana;font-size:11px;">
&lt;ec:table 
items="pres"
action="${pageContext.request.contextPath}/test.jsp"
imagePath="${pageContext.request.contextPath}/images/table/*.gif"
title="Presidents"
width="60%"
rowsDisplayed="5"
&gt;
&lt;ec:row&gt;
&lt;ec:column property="name"/&gt;
&lt;ec:column property="nickname"/&gt;
&lt;ec:column property="term"/&gt;
&lt;/ec:row&gt;
&lt;/ec:table&gt;
</pre> 

<br>

<p style="font-family:Verdana;font-size:11px;width:500px">
Note: if you are not seeing any images then be sure to include the images included with the distribution. 
This example assumes that the images are in an /images/table/ directory. You can see this by looking at the
imagePath attribute on the eXtremeTable example. If your images are somewhere else then just adjust the 
imagePath.
</p>

</body>
</html>


分享到:
评论

相关推荐

    ectable的基本用法

    在本节中,我们将详细介绍 Ectable 的基本用法,包括属性的含义和实现方法。 国际化 Ectable 支持国际化,可以根据不同的语言和国家设置对应的语言资源文件。例如,我们可以通过在 web.xml 文件中添加以下配置来...

    ECTable配置方法.txt eXtremeComponents集成方法

    ### ECTable配置方法与eXtremeComponents集成详解 #### 一、概述 本文档主要介绍了如何在项目中配置并集成eXtremeComponents框架中的ECTable组件。eXtremeComponents是一款功能强大的Java Web组件库,尤其适用于...

    ectable 相关文档

    本篇将深入探讨 `ectable` 的核心特性和使用方法。 首先,我们要理解 `ectable` 的基本概念。它是一个基于 JavaScript 的表格库,支持多种前端框架如 React、Vue 和 Angular。`ectable` 的主要目标是提供高性能的...

    ectable 代码

    3. **数据管理**:为了存储和操作数据,"ectable"可能使用了如JSON或CSV格式,这些都是Web上常见的数据交换格式。它可能还集成了Ajax技术,使得数据能在后台和服务端之间异步传输,提高用户体验。 4. **API接口**:...

    ECTable+Struts2+Hibernate+Spring S2SHTest.part1.rar

    ECTable+Struts2+Hibernate+Spring S2SHTest.part1.rar ECTable+Struts2+Hibernate+Spring S2SHTest.part1.rar

    ectable标签的详细使用

    4. **useAjax**:控制表格是否使用Ajax技术进行分页、过滤和排序等操作。默认为`true`,启用Ajax可以提供更流畅的用户体验。 5. **doPreload**:是否开启预读取技术,预读取可以提高页面加载速度。默认值为`true`。...

    ectable _mjhu

    下面我们将详细解释这些属性及其用法: 1. **tableId**:此属性用于设置表格的唯一标识,默认值为"ec"。当同一页面内存在多个`&lt;ec:table&gt;`时,必须为每个表格指定不同的tableId以区分它们。 2. **theme**:设置...

    ecTable例子

    开发者可以通过引入这个jar包,直接在Java环境中使用ecTable的功能。 2. **CSS**:CSS用于定义网页的样式和布局。ecTable的CSS文件通常包含了表格的样式定义,如单元格的颜色、字体、边框、对齐方式等。通过修改或...

    EcTableDemo

    EcTableDemo是一个以EcTable为中心的小型项目,旨在全面展示EcTable的各种功能和用法。EcTable是一款专门用于数据展示和操作的组件,它在IT领域中常被应用于数据分析、报表制作以及用户界面的构建。这个项目对于学习...

    ectable属性

    6. **classic**:如果设为true,将使用传统的简单列表模式。默认为false,通常推荐使用现代的交互方式。 7. **autoIncludeParameters**:默认为true,表示在翻页、过滤、排序时,会自动将当前页的表单字段以隐藏...

    ECTable+Struts2+Hibernate+Spring S2SHTest.part2.rar

    ECTable+Struts2+Hibernate+Spring S2SHTest.part2.rar ECTable+Struts2+Hibernate+Spring S2SHTest.part2.rar

    eXtremeComponents jar+doc+example

    "example"部分指的是实例程序或者示例代码,这些通常是已编写好的代码片段,演示了`ECTable`的各种用法。通过运行和研究这些示例,开发者可以直观地看到如何在实际项目中应用`ECTable`,从而加快学习进程。示例代码...

    超级详细的ecside标签部分属性说明

    ecside标签是ECTable的一个组件,用于生成列表。下面是ecside标签部分属性的详细说明: 1. 属性:tableId 描述:设置列表的唯一标识,默认为"ec",当一个页面内有多个ECSIDE列表时,必须为每个列表指定不同的table...

    ecside帮助文档

    **`formԭȵĿ,ectableһѾڵı`** - 表单元素:这里提到了ecside已经内置了一些表单元素,如输入框、下拉列表等,可以方便地在表单中使用。 #### 6. **`ڵ˼·ҪǸѾڵıϢ뵽ectableform`** - 数据绑定:这部分...

Global site tag (gtag.js) - Google Analytics