Función de implementación: implementar la Tabla T arrastrando y guardar el nivel cambiado debido a la arrastre.
código JSP
<div id = "mainContainer"> <div> <div id = "b_center"> <div id = "la-deceta-table-table"> <div> <h2 style = "margen-bottom: 0px; margin-top: 0px; altura: 43px; línea-height: 43px;"> gestión de menú </h2> <span style = "color: rojo"> por favor usa y suelta la longitud de la línea de la línea de la línea < id = "addlg" type = "button"> <img src = "/center/images/btn_add.png"> Agregar menú </botón> </div> <br> <div> <table cellPacing = "0" id = "showTable" style = "word-wrap: ruptura de ruptura; break-break: break-all; table-layout: inhherit; backffffffffe: #ffff! <th style = "text-align: centro; ancho: 10%;"> número </th> <th align = "center" style = "text-align: centro; ancho: 17%"> nombre del menú </th> <!-<th align = "center" style = "text-align: centro"> nivel de menú </th> <th align = "center" estilo = "text-align: centro"> th/th th thmed "<t th th thmen" <th thmen "<th thmen" </th th thmen "</th th thmen" </th th thmen "</th th thmen" </th thmen "</th th thmen" </th th thmen "</th th thmen" </th th thmen "</" Menú "</" Menú "</" Menú ". style = "Text-Align: Center"> Menú de segundo nivel </th>-> <th align = "Center" style = "text-align: centro; ancho: 18%"> menú nombre en inglés </th> <th align = "center" style = "text-align: centro; ancho: 15%"> tipo de menú </th> <th align = "center" style = "text-align: centro; width: 20%%"%" <th align = "Center" style = "text-align: Center; ancho: 20%"> operación </th> </tr> </thead> <tbody id = "data-list" style = "text-align: center;"> <% if (menulist! = null && menulist.size ()> 0) {para (int i = 0; i <menulist.size (); i ++) {json) menulist.getjsonObject (i); Menú menú = (menú) jsonObject.Tobean (json.getjsonObject ("menú"), menú.class); %> <tr id = "<%= menú.getLevel ()%>"> <td id = "<%= menú.getMenuid ()%>"> <%= menú.getLevel ()%> </td> <td> <div> <%= menú.getMenUname ()%> </div> </td> <td>> <div> <%= menú.getenMename () == null? "": menú.getenMenMeUname ()%> </div> </td> <!-<td> <div> <%// if (menú.gethassecond () == 1) {%> menú de primer nivel <%//} else {%> menú de segundo nivel <%//}%<}%Dive> </Div Div <div> <%// if (json.getString ("ischild"). Equals ("1")) {%> <a href = "javascript: void (0)" rel = "nofollow externo" rel = "externo nofollow" rel = "nofollow externo" onClick = "getChildMenu ('<%// menú.getMenuid ()%>')"> Ver </a> <%//} else {%> Ninguno <%///}%> </div> </td> -> <td> <div> <%if (menú.getMenutype () == 0) {%> Tipo de sistema <%} si ((menú> <%if (menú. 1) {%> Tipo de texto <%} else {%> Tipo de enlace <%}%> </div> </td> <td> <%if (menú.getState () == 0) {%> <button type = "button" onClick = "ChangeMenustate ('<%= Menu.getMenUname ()%>', <%Menu.getMenUid ()%, 1, 1), 1)" Button) "Button", 1) "Button)" Button> Button "Button". type = "Button" Style = "Fondo: #EaAea; Color: #D0D0D0;"> Ocultar </botón> <%} else {%> <Button type = "Button" Style = "Fondo: #EaAea; Color: #D0D0D0;"> Show </Button> <Button Type = "Button" On Click = "ChangeMenustate ('<%= Menu.getMenuname () ()) %> ', <%= menú.getMenuid ()%>, 0) "> ocultar </botón> <%}%> </td> <shor nofollow "style =" color: rojo; ancho: 30px; pantalla: bloque en línea "; id = "<%= menú.getMenuid ()%>"> </a> </div> <%}%> <%if (menú.getMenutype ()! = 0) {%> <div style = "float: float: right; margin-right: 10px;"> <a href = "javaScripción: nofar style = "Color: Red; Ancho: 30px; Display: Inline-Block;" id = "<%= menú </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </shi </div> <div style = "altura: 50px; línea-height: 50px;"> <div style = "display: none;"> <a href = "#" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "nofollow externo"> Acerca de nosotros </a> | | <a href = "#" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow"> weibo </a> | <a href = "#" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "nofollow" externo "rel =" externo externo "rel =" nofollow externo "rel =" nofollow "rol" rel = "rElling externo" Rel = "externo externo" externo "externo" externo "Rel" Rel "Rel" Rel "Rel" externo "Rel" externo "Rel" externo "externo" Rel " nofollow "rel =" externo nofollow "rel =" externo nofollow "rel =" externo nofollow "rel =" externo nofollow "rel =" externo nofollow "rel =" externo nofollow "rel =" nofollow "rel =" nofollow "rol" rol "rEllollo externo" Rel = "rElollo externo" REL = "RELFollow externo Rel =" Rel = "externo Rel" Rel = "RELFollow externo" externo Rel "Rel" Rel "externo" Rel "Rel" Rel "Rel" Rel "Rel" RELLOW ALGULA "EXTERNA" REL ALGO ALGULO "REL ALGOLA" REL ALGOLA CERTER "Rel" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "nofollow externo" nofollow "> blog </a> | <a href ="#"rel =" externo "rel =" rario de rato externo "Rel =" Rel = "externo" Rel = "Rel =" externo " <a href = "#" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow" rel = "externo nofollow"> Política de privacidad </a> </div> <p> incontes.com, todos los derechos reservados. <span> </span> </p> </div> <script src = "/cvc/center/js/cached_lalay_reports.jss.js" type = "text/javaScript"> </script> <script src = "/cvc/center/js/cached_lay_reports_cus.js" type = "text/javaScript"> </script> <div id = "máscara"> </div> <divi = "addlogo" style = "Display: Ninguno; Z-Index: 12; Ancho: 800px; Height: Auto; Margin-Left: -50px;"> <div> <span style = "font-size: 16px; margin-left: 20px; color: #fff; margin-top: -5px;" </div> <div id="addZ"> <div id="registerDiv"> <form id="menuForm" method="post" action="<%=path %>/webCenter.do"> <input type="hidden" name="method" value="saveOrUpdateMenu"> <input type="hidden" name="pageIndex" value="1"> <input type="hidden" name="conId" value = "" < %= conid %> "> <input type =" Hidden "name =" numb1 "valor =" < %= numb1 %> "> <input type =" hidden "name =" numB2 "valor =" < %= numb22 %> "> <input type =" hidden "id =" menú "name =" menú "valor ="-1 ""> <pla> <tr> <tr> <td> menú de menú Nombre </span> </td> <td> <input type = "text" id = "menú_name" name = "menUname" style = "margin: 10px 0px; display: inline-block; altura: 34px;"/> <span> </span> </td> </tr> <!-<tr> <td> nivel de menú: </td> <td> <tnect Id = " name = "menú_level" style = "margin: 10px 0px"> <opción valor = "-1"> Seleccione ... </opción> <opción valor = "1"> Menú de primer nivel </opción> <opción valor = "2"> Segundo nivel </opción> </select> </span> </td </td> </tr> <tri ID = "menú_parent_tr" style = "visualwer: Ninguna" Menu "Menú" TD> Menú "TD> Menú de Padres". </td> <td> <select id="menu_parent" name="menu_parent" style="margin:10px 0px"> <option value="-1">Please select...</option> </select> <span></span> </td> </td> </tr>--> <tr> <td> Menu type</td> <td> <select id="menuType" name="menuType" style = "margin: 10px 0px; display: inline-bloock; width: 350px;"> <opción valor = "-1"> Seleccione ... </opción> <opción valor = "1"> Tipo de imagen </opción> <opción valor = "2"> Tipo de enlace </opción> </select> </td> </tr> <tri-iD = "imgTexttr" style = "visual: Ninguno" ninus "</TDET </td </td> </tr> <tri:" IMGTEXTTR "style =" visual <TD> <TextArea Rows = "45" cols = "70" name = "menucontent" id = "menucontent" style = "display: inline-blok;"> </sextarea> </td> </td> <tr id = "linktr" style = "visual: none"> <TD> Dirección de salto </td> <td> Por favor, llene la dirección completa de enlace externo, que debe incluir <litero <liteba = "visual style = "Color: Red"> http: // </span> Por ejemplo: http: //www.baidu.com </br> <input type = "text" id = "menúrl" name = "menúrl" style = "margen: 10px 0px"/> <span style = "margen: 10px 0px"> </span> </td> </tr> <tr> <tr> <tr> <tr> colspan = "2"> <hr style = "margin-bottom: 10px;"> <input id = "menú_add" type = "button" value = "add" style = "border-radius: 0; width: 260px; altura: 40px; margin: margin: auto 50px; margin: 20px"/> </td> </tr> </table> </div divi </div> <div id = "Childmenu" style = "Display: Ninguno; Z-Index: 12; Ancho: 650px; Height: Auto; Margin-Left: -325px;"> <div ID = "Childz"> <div style = "margen-top: -40px;"> <span style = "font-tize: 16px; margen-left: 20px; color: #fff" " id = "gn_title"> menú de segundo nivel </span> <a id = "cerrador_modal"> </a> </div> <div id = "registroDiv"> <table cellPacing = "0" style = "word-wrap: break-word; broata de palabras: break-todo; table-layout: herhherit; "> <thead> <tr> <th style =" text-align: centro "> número </th> <th th th align =" center "style =" text-align: centro "> nombre del menú </th> <th th align =" center "style =" text-align: centro "> nivel de menú </th> <th ththing =" center "style" style = "style-" text: style = "text-align: centro" menú </th> <th align = "Center" style = "text-align: Center"> Tipo de menú </th> <th align = "Center" style = "Text-Align: Center"> Modificar </th> <th align = "center" style = "text-align: Center"> Delete </th> </tr> </table> </div> </div> </iv> <script type = "text/jawrcript" src = "<<%= ruta%>/cvc/center/js/my97datepicker/wdatepicker.js"> </script> <script src = "<%= path%>/cvc/center/js/shind.js" type = "text/javaScript"> </script> <script <script src = "<%= path%>/cvc/center/js/validform_v5.3.2.js" type = "text/javascript"> </script> <script charset = "utf-8" src = "<%= path%>/tran src = "<%= ruta%>/trenes/js/prettify/lang/zh_cn.js"> </script> <script charset = "utf-8" src = "<%= path%>/trenes/js/pretify/plugins/code/pretty.js"> </script> <script type = "text/javaScript" src = "<%<%= prettify.js"> </script> <script type = "text/javaScript" src = "<%=" <%= pretty %>/cvc/center/js/jQuery-1.10.2.min.js "> </script> <script charset =" utf-8 "type =" text/javascript "src =" < %= path %>/cvc/center/js/jQuery-1.10.2.min.js "> </script> <script charset =" utf-8 "type =" text/"jaxcript" src = "< %= rath %>/center/js/jQuery-ui.min.js"> </script. <script> var editor1; */if (menuname == "inglés") {alert ("por favor vaya al módulo de información básica para establecer el tipo de chino e inglés actual"); if (json.state == 1) {window.location.reload (); Stop: Function (Event, ui) {// Después de actualizar la clasificación var categoría = $ ("#showTable"). SATABLE ("ToArray"); }) nivel = 0; 1) {content += "{nivel:" + URL: "<%= Path%>/WebCenter.do?updateMenulevel", Tipo: "Post", DataType: "JSON", Data: "Menulist ="+Content, Success: Function (JSON) {}})}}); $ ("#menú_level"). Change (function () {$ ("#menú_parent"). vacío (); $ ("#menú_parent"). append ("<opción valor = '-1'> por favor seleccione ... </opción>") var nivel = $ ("#menú_level"). val (); if (nivel == 1) {$ ("#Menu_Parent_tr"); 2) {$ .AJAX ({url: "<%= path%>/webcenter.do?getFirstMenu", type: "get", dataType: "json", éxito: function (function) {if (resultado! = Null && result! = "" "&& length> 0) {for (var i = 0; i <result.length; i++)) value = '"+resultado [i] .menuid+"'> "+resultado [i] .menUname+" </option> "console.log (opción) $ ("#menú_parent "). append (opción);}} else {" alert ("no se ha creado un menú de nivel, crea el menú de primer nivel antes de crear el menú de auricular");}}}}) $ ("####Menú"). }}) // Seleccione el tipo gráfico $ ("#menutype"). Change (function () {if ($ ("#menutype"). Val () == 1) {$ ("#imgTexttr"). Show (); $ ("#linktr"). Hide (); $ ("#addz"). Css ("altura", "450px")). if ($ ("#menutype"). val () == 2) {$ ("#imgTextTr"). Hide (); $ ("#Menu_Name"). Val (); falso; contenido "); return false;}} if ($ ("#menutype "). val () == 2) {if (menúRL.trim () ==" "|| menúRl.trim (). longitud == 0) {alert (" por favor ingrese la dirección de salto "); return false;}} var menucount = <%= menulistize%>; if (menucount> = 19 = 19 y 19 $ ("#Menuid"). Val () == -1) $ ("#addlg"). Click (function () {$ ("#Mask"). show (); $ ("#addlogo"). show ();}) // cancelar $ (". Tk1_header"). Click (function () {{ubicación $ ("#ZShref"). Val ("); $ ("Body"). CSS ("Position", "Solding"); $ ("#Menu_Name"). Val (Data.MenUname); editor1.html (data.content); }}%>código de acción
@RequestMapping (params = "updateMenulevel", método = requestmethod.post) public void updateMenulevel (String Menulist, httpservletRequest solicitud, respuesta httpServletResponse) {try {httpsession session = this.getSession (solicitud); Adminuser Adminuser = session.getAttribute ("CenterAdminuser") == NULL? NULL: (Adminuser) Session.GetAttribute ("CenterAdminuser"); if (adminuser == null) {try {Response.sendedirect (request.getContextPath ()+"/center/index.jsp"); } catch (Exception e) {E.PrintStackTrace (); }} else {string conid = request.getSession (). getAttribute ("conid") == null? nulo: request.getSession (). getAttribute ("conid"). toString (); if (conid == null) {Response.sendedirect (request.getContextPath ()+"/Center/index.jsp"); } JSONArray Array = JSonArray.FromObject (menulist); for (int i = 0; i <array.size (); i ++) {jsonObject json = array.getJsonObject (i); Menú menú = WebService.getMenubyid (json.getInt ("menuid")); menú.setLevel (json.getInt ("nivel")); WebService.saveObject (menú); }}} Catch (Exception e) {E.PrintStackTrace (); }El ejemplo anterior de la Tabla de implementación de Java TRATGing es todo el contenido que he compartido con usted. Espero que pueda darle una referencia y espero que pueda apoyar más a Wulin.com.