easyList.jsp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <#import "function.ftl" as func>
  2. <#assign comment=model.tabComment>
  3. <#assign class=model.variables.class>
  4. <#assign package=model.variables.package>
  5. <#assign comment=model.tabComment>
  6. <#assign classVar=model.variables.classVar>
  7. <#assign system=vars.system>
  8. <#assign commonList=model.commonList>
  9. <#assign pkModel=model.pkModel>
  10. <#assign pk=func.getPk(model) >
  11. <#assign pkVar=func.convertUnderLine(pk) >
  12. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  14. <html>
  15. <head>
  16. <title>${comment }管理</title>
  17. <%@ include file="/commons/include/easyuiGet.jsp"%>
  18. <script type="text/javascript">
  19. function OperationRow(value, row, index) {
  20. var editBtn = "<a href='edit.ht?${pkVar}="+row.${pkVar}+"'>编辑</a>";
  21. var delBtn = "<a href='#' onclick=del('"+row.${pkVar}+"')>删除</a>";
  22. var seperator = " | ";
  23. return editBtn + seperator + delBtn ;
  24. }
  25. function del(id){
  26. $.ajax({
  27. url: '<#noparse>${ctx}</#noparse>/${system}/${package}/${classVar}/del.ht?${pkVar}='+id,
  28. type: 'POST',
  29. success: function(result){
  30. $('#easyList').datagrid('reload');
  31. }
  32. });
  33. }
  34. function add(){
  35. window.location.href='edit.ht';
  36. }
  37. </script>
  38. </head>
  39. <body class="pannel-common easyui-layout" >
  40. <div id="tb" style="height:auto">
  41. <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="add()">新增</a>
  42. </div>
  43. <table id="easyList" class="easyui-datagrid" title="${comment }列表"
  44. data-options="cache:false,rownumbers:true,singleSelect:true,fit:true,fitColumns:true,pagination:true,method:'post',url:'getList.ht',toolbar:'#tb'">
  45. <thead >
  46. <tr>
  47. <th data-options="field:'${pkVar}Id',checkbox:true,fixed:true"></th>
  48. <#list model.commonList as col>
  49. <#assign colName=func.convertUnderLine(col.columnName)>
  50. <th data-options="field:'${colName}',width:70<#if (col.colType=="java.util.Date") >,formatter:dateFormater</#if>">${col.getComment()}</th>
  51. </#list>
  52. <th data-options="field:'operation',width:120,formatter:OperationRow,align:'center'">操作</th>
  53. </tr>
  54. </thead>
  55. </table>
  56. </body>
  57. </html>