• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
阿米拌豆腐
种一棵树最好的时间是十年前,其次是现在。
博客园    首页    新随笔    联系   管理    订阅  订阅

extremecomponents

 

具体教程:

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

 

posted @ 2016-03-31 22:39  阿米拌豆腐  阅读(169)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3