码迷,mamicode.com
首页 > 其他好文 > 详细

extremecomponents

时间:2016-03-31 23:11:26      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:

 

具体教程:

http://www.cnblogs.com/QQParadise/articles/1488920.html

教程中涉及到springmvc的相关知识

 

下载地址:http://sourceforge.net/projects/extremecomp/

 

下载下来的jar包不知为何目录结构不对,换成项目中的jar包(extremecomponents-1.0.1.jar),可正常。

 

Web.xml

<!-- 配置tld文件,tomcat6以上,需要加jsp-config-->

    <jsp-config>

    <taglib>

        <taglib-uri>/tld/extremecomponents</taglib-uri>

        <taglib-location>/WEB-INF/tld/extremecomponents.tld</taglib-location>

    </taglib>

  </jsp-config>

  <!-- 配置过滤器-->

    <filter>

        <filter-name>eXtremeExport</filter-name>

        <filter-class>org.extremecomponents.table.filter.ExportFilter</filter-class>

        <!-- 在 调用过滤器的doFilter()方法前设置响应报头,默认在之后-->

        <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>

 

拷贝test.jsp   css     images    到项目目录下。

 

 

载入test.jsp

 

 

JSP中ec标签解析

<ec:table
  items="presidents"
  var="pres"
imagePath="${pageContext.request.contextPath}/images/*.gif"
  action="${pageContext.request.contextPath}/presidents.run"
  filterable="false"  //过滤器
  sortable="false"  //排序
  >
 <ec:row highlightRow="true"> //鼠标移到上边时,高亮
    <ec:column property="name" filterCell="droplist"
/> //列过滤器
    <ec:column property="lastName" sortable="false"/> //可排序
  
    <ec:column property="term"/>
 
<ec:column property="lastName">
      ${pres.lastName} //指定page中的值
    </ec:column>
//视图,和导出文件相关
<ec:column property="lastName" viewsAllowed="pdf"/>
    <ec:column property="firstName" title=" "/> //表头
 
    
  </ec:row>
</ec:table>
 

 

 

添加样式

<ec:row
  style=""
  styleClass=""
  highlightClass=""
  />

 

添加js

<ec:row
  onclick=""
  onmouseover=""
  onmouseout=""
  />

 

Limit 分页显示,类似mysql中的limit

Context context = new HttpServletRequestContext(request);
LimitFactory limitFactory = new TableLimitFactory(context);
Limit limit = new TableLimit(limitFactory);
//设置总的行数,每页多少行
limit.setRowAttributes(totalRows, DEFAULT_ROWS_DISPLAYED);

 

extremecomponents

标签:

原文地址:http://www.cnblogs.com/amibandoufu/p/5343185.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!