EditControl.cshtml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @{
  2. ViewBag.Title = "编辑控件";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var controlId = request('controlId');
  7. var dataJson = top.Form.bindingFormJson;
  8. $(function () {
  9. $.each(dataJson, function (i) {
  10. if (dataJson[i].column == controlId) {
  11. var data = dataJson[i];
  12. $("#ControlId").val(data.column);
  13. $("#ControlName").val(data.remark);
  14. return false;
  15. }
  16. });
  17. })
  18. //保存表单
  19. function AcceptClick(callBack) {
  20. var data = {
  21. ControlId: $("#ControlId").val(),
  22. ControlName: $("#ControlName").val()
  23. }
  24. if (data.ControlName == "") {
  25. dialogTop("请填写字段名称", "error");
  26. }
  27. else {
  28. callBack(data);
  29. dialogClose();
  30. }
  31. }
  32. </script>
  33. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  34. <table class="form">
  35. <tr>
  36. <th class="formTitle">字段标识</th>
  37. <td class="formValue">
  38. <input id="ControlId" disabled type="text" class="form-control" />
  39. </td>
  40. </tr>
  41. <tr>
  42. <th class="formTitle">字段名称</th>
  43. <td class="formValue">
  44. <input id="ControlName" type="text" class="form-control" />
  45. </td>
  46. </tr>
  47. </table>
  48. </div>