导出模块化使用手册

一、后台方法

1.复制ExportController至项目内作为通用导出控制

@RequestParam(value = "exportid") String exportid,//配置文件中定义的调用参数的key前缀
@RequestParam(value = "exportheaders") String headers,
@RequestParam(value = "exportfilename") String filename,
@RequestParam(value = "exporttype") String type

以上4个参数为必要元素

2.定义CommonResourse.properties中导出所指向的取数类及方法

####
001.class=com.intime.model.workflow.impl.ExportServiceImpl
001.method=queryGroupTypeList

二、前端调用方法

1.调用common.export.jsp

<script src="lib/js/common.export.js?t=<%=versioncode %>" type="text/javascript"></script>

2.页面定义按钮

<div class="searchbutton">
      <input type="button" id="search" value="查询" />
      <input type="reset" value="重置"/>
      <input type="button" id="export" value="导出" />
</div>

红色为示例按钮

3.js中定义导出

$.common.export({
    expid:"001",
    btn:"#export",
    type:"xls",
    firstrow:null,
    lastrow:null,
    action:"<%=basePath%>export.htm",
    form:"#searchform",
    grid:"#gridcontent",
    filename:"测试"
})

参数解释如下:

common.export
expid后端配置文件中的对应的导出编号,前端与后端需约定好
btn 页面中定义的导出按钮的id,使用#
 type 导出类型,现只支持xls
 firstrow 默认无
 lastrow 最后一行,可自定义内容,字段需和jqgrid匹配(默认无)
 action 导出后台url
 form

 指向的查询formID,使用#

 grid 指向的jqgrid的ID,使用#
 filename 导出的命名
  
posted on 2016-03-04 09:45 住家阿呆 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/inncho/p/5240976.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值