freemark动态加载列表数据
来源:互联网 发布:如何优化页面响应速度 编辑:程序博客网 时间:2024/04/29 10:12
1.ftl页面中 <table class="table table-striped table-hover table-bordered" name="record" id="editable-sample"> </table> function pay_details(game_id){ $("[name='record']").html(""); //获取上面table的name,清空table $.post('${basePath}/agency/pay_details.shtml',{ "game_id":game_id },function(result){ var html_=""; var html__=""; html_=html_+ "<thead >"+ "<tr>"+ "<th>游戏ID</th>"+ "<th>充值人</th>"+ "<th>游戏用户名</th>"+ "<th>金额</th>"+ "<th>兑换率</th>"+ "<th>充值金币</th>"+ "<th>订单号</th>"+ "<th>充值时间</th>"+ "<th>支付状态</th>"+ "<th>充值状态</th>"+ "<th>充值类型</th>"+ "</tr>"+ "</thead>"; $.each(result, function(idx, obj) { html__=html__+ "<tr>"+ "<td>"+obj.GameID+"</td>"+ "<td>"+obj.TrueName+"</td>"+ "<td>"+obj.UserName+"</td>"+ "<td>"+obj.PayMoney+"</td>"+ "<td>"+obj.ExchangeRate+"</td>"+ "<td>"+obj.InMoney+"</td>"+ "<td>"+obj.OrderID+"</td>"+ "<td>"+obj.AddTime+"</td>"+ "<td>"+(obj.PaySuccess=='true'? '已支付' :'未支付')+"</td>"+ "<td>"+(obj.InSuccess=='true'? '已充值' : '未充值')+"</td>"+ "<td>"+obj.TypeInfo+"</td>"+ "</tr>"; }); $("[name='record']").html(html_+html__);//把固定行和动态遍历的行加载到table中 });}2.controller中提供List数据 @RequestMapping(value = "pay_details", method = RequestMethod.POST) @ResponseBody public List<Map<String, String>> pay_details(HttpServletRequest request) { List<Map<String, String>> si = new ArrayList<Map<String, String>>(); if (request.getParameter("game_id") != null && request.getParameter("game_id") != "") { // 发送 POST 请求 String game_id = request.getParameter("game_id").toString(); String sr = RequestService.sendPost(InterfaceAddressConfig.get("GetOrderList"), "game_id="+ game_id + "&pageSize=900000&pageIndex=1");// 请求充值成功的conditions=1为充值成功,每页90w条 HashMap<String, String> stringToMap = StringToMap.StringToMap(sr); if (!"[]".equals(stringToMap.get("list").toString())) { String replace = stringToMap.get("list").toString().replace("[", "").replace("]", ""); String[] arr = replace.split("\\},\\{"); List<String> list = java.util.Arrays.asList(arr); for (String list_ : list) { String lists = "{" + list_.replace("{", "").replace("}", "") + "}"; System.out.println(lists); HashMap<String, String> itemMap = StringToMap.StringToMap(lists); si.add(itemMap); } } } return si; }
0 0
- freemark动态加载列表数据
- freemark-数据列表的html为何要二次解析
- 下拉列表数据动态加载 springmvc jquery ajax
- 动态加载列表框
- js动态加载列表
- 从属性列表加载数据
- Android 加载列表数据
- Tree:加载列表数据
- Ajax - 动态加载列表框
- webservice动态加载下拉列表
- Ajax动态加载列表框
- Ext 动态加载数据
- Menu动态加载数据
- ListView数据动态加载
- Listview动态加载数据
- Listview动态加载数据
- ListView动态加载数据
- Listview动态加载数据
- 栈实现简单的计算器
- PHP中Redis管道
- Linux VPS网站文件、数据库备份及更换主机搬家过程记录
- 屌丝程序员搭建的DNS服务器的心路历程
- mmap 文件映射内存详解
- freemark动态加载列表数据
- Vue学习之路---No.3(分享心得,欢迎批评指正)
- sql学习笔记(韩顺平)
- jquery 通配符和选择器
- ssh中子窗口关闭之后刷新父窗口的问题
- 正则表达式大总结
- 删除hbase表时 org.apache.hadoop.hbase.TableNotDisabledException 解决方法
- bzoj2140对tarjan算法的一些理解
- Windows7+cuda 7.5+vs2010