autoFormDbFieldForTableList.vm 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <script type="text/javascript">
  2. jQuery('#addAutoFormDbFieldForTableBtn').linkbutton({
  3. iconCls: 'icon-add'
  4. });
  5. jQuery('#delAutoFormDbFieldForTableBtn').linkbutton({
  6. iconCls: 'icon-remove'
  7. });
  8. jQuery('#addAutoFormDbFieldForTableBtn').bind('click',
  9. function() {
  10. var tr = jQuery("#add_autoFormDbFieldForTable_table_template tr").clone();
  11. jQuery("#add_autoFormDbFieldForTable_table").append(tr);
  12. resetTrNum('add_autoFormDbFieldForTable_table');
  13. return false;
  14. });
  15. jQuery('#delAutoFormDbFieldForTableBtn').bind('click',
  16. function() {
  17. jQuery("#add_autoFormDbFieldForTable_table").find("input:checked").parent().parent().remove();
  18. resetTrNum('add_autoFormDbFieldForTable_table');
  19. return false;
  20. });
  21. jQuery(document).ready(function() {
  22. jQuery(".datagrid-toolbar").parent().css("width", "auto");
  23. if (location.href.indexOf("load=detail") != -1) {
  24. jQuery(":input").attr("disabled", "true");
  25. jQuery("a").each(function() {
  26. jQuery(this).css("cursor", "default");
  27. jQuery(this).removeAttr("href");
  28. jQuery(this).removeAttr("onclick");
  29. });
  30. jQuery(".datagrid-toolbar").hide();
  31. }
  32. //将表格的表头固定
  33. jQuery("#autoFormDbFieldForTable_table").createhftable({
  34. height: '400px',
  35. fixFooter: false
  36. });
  37. });
  38. function deleteOne(obj) {
  39. var tableId = jQuery(obj).parent().parent().parent().parent().attr("id");
  40. jQuery(obj).parent().parent().parent().remove();
  41. resetTrNum(jQuery("input[name='dbType']:checked").val() + "_div #" + tableId);
  42. }
  43. </script>
  44. <div style="padding: 3px; height: 25px;width:auto;" class="datagrid-toolbar">
  45. <a id="addAutoFormDbFieldForTableBtn" href="#">添加</a>
  46. <a id="delAutoFormDbFieldForTableBtn" href="#">删除</a>
  47. </div>
  48. <table border="0" cellpadding="2" cellspacing="0" id="autoFormDbFieldForTable_table">
  49. <tr bgcolor="#E6E6E6">
  50. <td align="center" width="40px" bgcolor="#EEEEEE">编码</td>
  51. <td align="center" width="40px" bgcolor="#EEEEEE">选择</td>
  52. <td align="left" width="120px" bgcolor="#EEEEEE">字段</td>
  53. <td align="left" width="120px" bgcolor="#EEEEEE">字段文本</td>
  54. <td align="center" width="50px" bgcolor="#EEEEEE">操作</td>
  55. </tr>
  56. <tbody id="add_autoFormDbFieldForTable_table">
  57. #if($!{autoFormDbFieldList})
  58. #set($count=0)
  59. #foreach($!{info} in $!{autoFormDbFieldList})
  60. <tr>
  61. <input name="autoFormDbFieldList[${count}].id" type="hidden" value="$!{info.id}" />
  62. <input name="autoFormDbFieldList[${count}].createName" type="hidden" value="$!{info.createName}" />
  63. <input name="autoFormDbFieldList[${count}].createBy" type="hidden" value="$!{info.createBy}" />
  64. <input name="autoFormDbFieldList[${count}].createDate" type="hidden" value="$!{info.createDate}" />
  65. <input name="autoFormDbFieldList[${count}].updateName" type="hidden" value="$!{info.updateName}" />
  66. <input name="autoFormDbFieldList[${count}].updateBy" type="hidden" value="$!{info.updateBy}" />
  67. <input name="autoFormDbFieldList[${count}].updateDate" type="hidden" value="$!{info.updateDate}" />
  68. <input name="autoFormDbFieldList[${count}].sysOrgCode" type="hidden" value="$!{info.sysOrgCode}" />
  69. <input name="autoFormDbFieldList[${count}].sysCompanyCode" type="hidden" value="$!{info.sysCompanyCode}" />
  70. <input name="autoFormDbFieldList[${count}].autoFormDbId" type="hidden" value="$!{info.autoFormDbId}" />
  71. <td align="center"><div style="width: 40px;" name="xh">$!{velocityCount}</div></td>
  72. <td align="center"><input style="width:40px;" type="checkbox" name="ck" /></td>
  73. <td align="left"><input name="autoFormDbFieldList[${count}].fieldName" maxlength="32" type="text" class="inputxt" style="width:120px;" value="$!{info.fieldName}" /></td>
  74. <td align="left"><input name="autoFormDbFieldList[${count}].fieldText" maxlength="50" type="text" class="inputxt" style="width:120px;" value="$!{info.fieldText}" /></td>
  75. <td align="center"><div style="width: 50px;" align="center">[<a name="delAutoFormDbFieldForTableOneBtn" href="javascript:void(0)" onclick="deleteOne(this)">删除</a>]</div></td>
  76. </tr>
  77. #set($count=$count+1)
  78. #end
  79. #end
  80. </tbody>
  81. </table>