구현 기능 : 구현 테이블 T 드래그 및 저장 레벨이 드래그하여 변경되었습니다.
JSP 코드
<div id = "maincontainer"> <div> <div id = "b_center"> <div id = "런치-데테일-테이블"> <div> <h2 style = "margin-bottom : 0px; margin-top : 0px; 높이 : 43px; line-height : 43px;"> 메뉴 관리 </h2> <color : rejeast ""rejeast "rejeast" id = "addlg"type = "button"> <img src = "/center/images/btn_add.png"> 추가 메뉴 </div> <br> <div> <table cellpacing = "0"id = "showtable"style = "Word-word; Word-Break : Break-Layout : inherit; <th style = "텍스트-알림 : 중심; 폭 : 10%;"> 번호 </th> <th align = "center"style = "text-align ="text-align = "center; width : 17%"> 메뉴 이름 </th> <!-<th align = "center"style = "text-align : center"> 메뉴 레벨 </th> <th align = "style" "text- align : 메뉴 레벨"> 메뉴 레벨 "> Style = "Text-Align : Center"> 두 번째 레벨 메뉴 </th>-> <th align = "center"style = "text-align ="center; width : 18%"> 메뉴 영어 이름 </th> <the elign ="center "style ="텍스트-정렬 : 센터; width : 15%"> 메뉴 <th align ="style = "text- align : center; 20%"> <th align = "center"style = "text-align : center; width : 20%"> Operation </th> </tr> </thead> <tbody id = "data-list"style = "text-align : center;"> <% if (menulist! = null && menulist.size ()> 0) {or (int i = 0; i ++) {menulist.size () () () menulist.getjsonobject (i); 메뉴 메뉴 = (메뉴) jsonobject.tobean (json.getJsonObject ( "menu"), menu.class); %> <tr id = "<%= menu.getLevel ()%>"> <td id = "<%= menu.getMenuid ()%>"> <%= menu.getLevel ()%> </td> <td> <div> <%= menu.getMenuname ()%> </dd> <td> <div> <%= menu.getenMenUname () == null? "": menu.getenMenUname ()%> </div> </td> <!-<td> <div> <%// if (menu.gethassecond () == 1) {%> 첫 번째 레벨 메뉴 <%//} else {%> </div> </dd> <div> <%// if (json.getString ( "ischild"). Equals ( "1")) {%> <a href = "javaScript : void (0)"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow" onclick = "getChildMenu ( '<%// menu.getMenuid ()%>')"> view </a> <%//} else {%> none <%//}%> </div> </td> -> <td> <div> <%if (menu.getmenutype () = 0) {menu. 1) {%> 텍스트 유형 <%} else {%> 링크 유형 <%}%}%> </div> </td> <td> <%if (menu.getState () == 0) {%> <버튼 유형 = "button"onclick = "Changemenustate ( '<%= menu.getmenuname ()%>', <%= menu.getmenuid ()). type = "button"style = "background : #eaeaea; color : #d0d0d0;"> hide </button> <%} else {%> <버튼 유형 = "button"style = "backgring : #eaea; color : #d0d0d0;"> show </button> <button type = "button"onclick = "changemenustate. %> ', <%= menu.getMenuid ()%>, 0) "> hide </button> <%}%> </td> <td> <%if (menu.getMenUtype ()! = 0) {%> <div> <div style ="float : right; margin-right : 10px; "> href ="javaScript : void (0) ""external nofolly ". rel = "외부 nofollow"style = "색상 : 빨간색; 너비 : 30px; 디스플레이 : 인라인 블록;" id = "<%= menu.getMenuid ()%>"> </a> </div> <%}%> <%if (menu.getMenUtype ()! = 0) {%> <div style = "float : right; margin-right : 10px;"> <a href = "javaScript : void (0)"rel = "external nof anclollow"external nof anjof "external nof anteral nof ance" nofollow "style ="색상 : 빨간색; 너비 : 30px; 디스플레이 : 인라인 블록; " id = "<%= menu.getMenuid ()%>"> </a> </a> </div> <%}%> </td> </tr> <%}} else {%> <tr> <td colspan = "6"align = "center"> 아직 데이터 없음 </td> </tr>}%> </tably> </table> </table> </table> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div style = "높이 : 50px; 라인-하이트 : 50px;"> <div style = "display : none;"> <a href = "#"rel = "external nofollow"rel = "external nofollow"rel = "external nofollow"rel = "external nofollow">. <a href = "#"rel = "external nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"> weibo </a> | <a href = "rel ="rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "external nofollow"rel = "external nofollow"rel = rel = "external nofollow"rel = "external nofollow"rel =. rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "external nofollow"rel = "external nofollow"rel = "external nofollow"rel = "external nofollow"rel = rel = "external nofollow"rel = "external nofollow" "external nefollow". rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "외부 nofollow"rel = "external nofollow"rel = "external nofollow"rel = "external nofollow"nofollow "</a> <a href ="href = "href ="external nofollow "rel = nofollow "rel ="외부 nofollow "rel ="외부 nofollow "rel ="외부 nofollow "> 서비스 약관 </a> | href ="#"rel ="external nofollow "rel ="외부 nofollow "rel ="external nofollow "rel ="external nofollow "> privacy </div> <p> incongress. 예약. <Span> </span> </p> </div> <스크립트 src = "/cvc/center/js/cached_lay_reports.js"type = "text/javaScript"> </script> <script src = "/cvc/js/js/cached_lay_reports_cus.js"text "/javascript"> id = "mask"> </div> <div id = "addlogo"style = "display : none; z-index : 12; 너비 : 800px; 높이 : auto; margin-left : -50px;"> <div> <font-syle = "font-syle : 16px; margin-left : 20px; margin-top; 메뉴 </span> <a id = "close_modal"> x </a> </div> <div id = "addz"> <div id = "registerdiv"> <form id = "menuforf"method = "post"action = "< %= path %>/webcenter.do"> <input type = "hidden"name = "value ="input type = "input type" 이름 = "pageIndex"value = "1"> <입력 유형 = "hidden"name = "conid"value = "< %= conid %>"> <입력 유형 = "hidden"name = "numb1"value = "< %= numb1 %>"> <입력 유형 = "hidden"namb2 "value = numb2 %"> 이름 = "menuid"value = "-1"> <table> <tr> <td> <span> 메뉴 이름 </span> </td> <td> <입력 유형 = "text"id = "menu_name"name = "menuname"style = "마진 : 10px 0px; display : inline-block; 높이; <td> 메뉴 레벨 : </td> <td> <select id = "menu_level"name = "menu_level"style = "margin : 10px 0px"> <옵션 값 = "-1"> 선택 ... </옵션> <옵션 값 = "1"> 첫 번째 레벨 메뉴 </옵션> <옵션 value = "2"> Second Level 메뉴> </td> </td> id = "menu_parent_tr"style = "display : none"> <td> 부모 메뉴 : </td> <td> <select id = "menu_parent"name = "menu_parent"style = "margin : 10px 0px"> <옵션 값 = "-1"> select ... </옵션> </select> <pan> </td> </td> </td> </td> </td> 유형 </td> <td> <select id = "menutype"name = "menutype"style = "margin : 10px 0px; display : inline-block; width : 350px;"> <옵션 value = "-1"> 선택 ... </옵션> <옵션 vale = "1"> 그림 유형 </옵션> <옵션 value = "2"> 옵션> </td> id = "imgtexttr"style = "display : none"> <td> 텍스트 내용 </td> <td> <textarea rows = "45"cols = "70"name = "menucontent"id = "menucontent"style = "display : inline-block;"> </textArea> </td> <tr id = inlinktr ""style = ""style : "style :" "style :"style : "style :"style : "style" 주소 </td> <td> 완전한 외부 링크 주소를 작성하십시오. 여기에는 <span style = "color : red"> http : // </span>을 포함 해야하는 전체 외부 링크 주소를 작성하십시오 : http : //www.baidu.com </br> <입력 유형 = "텍스트"id = "menuurl"name = "menuurl"style = "margin : 10px 0px"/>>>>>>>. 0px "> </span> </td> </tr> <tr> <td align ="center "colspan ="2 "> <hr style ="margin-bottom : 10px; "> <입력 id ="menu_add "type ="button "value ="style = "border-radius : 0; width : 260px : 40px; 50px; 마진 : 20px "/> </td> </tr> </table> </form> </div> </div> </div> </div> <div id ="childmenu "style ="display : none; z-index : 12; 너비 : 650px; 스타일 = "마진-탑;"> <span style = "font-size : 16px; 마진-왼쪽 : 20px; 색상 : #fff"id = "gn_title"> 두 번째 레벨 메뉴 </span> <a id = "close"> </a> </div> <div id = "registerdiv"> <테이블 셀 프레이싱 = "0. Word-Break : Break-all; Table-Layout; "> <thead> <tr> <th Style ="Text-Align : Center "> 번호 </th> <th align ="center "style ="text-align : "center"> 메뉴 이름 </th> <th align = "center"style = "text-align :"> menu </th> <th align = "text-align": "텍스트": 메뉴 </th> <th align = "center"style = "text-align : center"> 메뉴 유형 </th> <th align = "center"style = "text-align :"text-align : "text-align :"center "> modify </th> <th align ="center "style ="text-align : center "> delete </th> </tr> </div> <scr type ="text/javas stram " src = "<%= path%>/cvc/center/js/my97datepicker/wdatepicker.js"> </script> <script src = "<%= path%>/cvc/center/js/setting.js"type = "text/javascript"> </script> <cript> src = "<%= path%>/cvc/center/js/validform_v5.3.2.js"type = "text/javaScript"> </script> <script charset = "utf-8"src = "<%= path%>/train/js/quintify/sindeditor.js"> src = "<%= path%>/train/js/prettify/lang/zh_cn.js"> </script> <script charset = "utf-8"src = "<%= path%>/train/js/prettify/prettify/code/prettify.js"> %>/cvc/center/js/jquery-1.10.2.min.js "> </script> <script charset ="utf-8 "type ="text/javaScript "src ="< %= path %>/cvc/cvc/cvc/js/jquery-10.2.min.js "> aptrset = utf-8"type = " src = "< %= path %>/js/jss/jquery-ui.min.js"> </script> <script> var editor1; */if (menuname == "English") {Alert ( "현재 회의 중국어 및 영어 유형을 설정하기 위해 기본 정보 모듈로 이동하십시오"; if (json.state == 1) {window.location.renoad ()} else {alert ( "#showtable"). STOM : var var categoryIds = $ ( "#showtable")를 업데이트 한 후 ( "toArray"); } level = 0; "#showtable tr"). 1) {레벨 += " URL : "<%= path%>/webcenter.do ??updatemenulevel", type : "post", datatype : "json", data : "menulist ="+content, success (json) {}})}); "#showtable"); $ ( "#menu_level"). change (function () {$ ( "#menu_parent"). empty (); $ ( "#menu_parent"). Append ( "<옵션 값 = '-1'> 선택 ... </옵션>") var level = $ ( "#menu_level"). 2) {$ .ajax ({url : "<%= path%>/webcenter.do ?? getfirstmenu", type : "get", datatype : "json", success : function (result) {if (result! = null && result! value = '+result [i] .menuid+"'>"+result [i] .menuname+"</옵션>"console.log (옵션) $ ( "#menu_parent"). Append (옵션);}} else {alert ( "수준 메뉴가 만들어졌습니다. 헤드폰 메뉴를 만들기 전에 수준 메뉴가 만들어졌습니다." }}) // 그래픽 유형 $ ( "#menutype"). change (function () {if ($ ( "#menutype"). val () == 1) {$ ( "#imgtexttr"). show (); $ ( "#linktr"). if ( "#menutype"). val () == 2) {$ ( "#imgtexttr"). show ( "#addz") "#menu." false; content "); return false;}} if ($ ("#menutype "). val () == 2) {if (menuurl.trim () ==" "|| menuurl.trim (). length == 0) {alert ("점프 주소를 입력하십시오 "); return false;}} var menucount = <%= menulistsize%>; "#menuid" $ ( "#addlg"). click (function () {$ ( "#mask"). show (); $ ( "#addlogo"). show ();}) // cance $ ( ". tk1_header"). 클릭 (function () {location.reload ();}) $ ( "#close"); 클릭 () {zstype "); "#zshref". val ( "#mask"); hide ( "body"). $ ( "body"). $ ( "#menUname"( "#menUtype"). editor1.html (data.content)} if (data.menutype == 2). }}%>액션 코드
@requestmapping (params = "updatemenulevel", method = requestmethod.post) public void updatemenulevel (String menulist, httpservletrequest request, httpservletreponse responsk) {httpsession session = this.getsession (requests (request); 관리자 관리자 = session.getAttribute ( "centerAdminuser") == null? null : (관리자) session.getAttribute ( "CenterAdminuser"); if (adminuser == null) {try {response.sendRedirect (request.getContextPath ()+"/center/index.jsp"); } catch (예외 e) {e.printstacktrace (); }} else {string conid = requestsession (). getAttribute ( "conid") == null? null : request.getSession (). getAttribute ( "conid"). toString (); if (conid == null) {response.sendRedirect (request.getContextPath ()+"/center/index.jsp"); } jsonArray array = jsonArray.fromObject (menulist); for (int i = 0; i <array.size (); i ++) {jsonobject json = array.getJsonObject (i); 메뉴 메뉴 = webservice.getMenubyId (json.getInt ( "MenuId")); menu.setlevel (json.getint ( "level")); WebService.saveObject (메뉴); }}} catch (예외 e) {e.printstacktrace (); }Java 구현의 위의 예는 내가 공유 한 모든 컨텐츠입니다. 나는 당신이 당신에게 참조를 줄 수 있기를 바랍니다. 그리고 당신이 wulin.com을 더 지원할 수 있기를 바랍니다.