Функция реализации: реализация таблицы t перетаскивание и сохранение уровня, измененного из -за перетаскивания.
код JSP
<div id = "maincontainer"> <div> <div id = "b_center"> <div id = "Запуск-detail-table"> <div> <h2 style = "margin-bottom: 0px; margin-top: 0px; рост: 43px; Red-hight: 43px;"> Управление Menu </h2> <span style = "color and ragempl span> ruge span> ruge span> ruge span> ruge span> ruge span> harcy span> ructip rance-span> harcy-span> harcy-span <Button Id = "addlg" type = "button"> <img src = "/center/images/btn_add.png"> Добавить меню </button> </div> <br> <div> <Таблица сотовой связи = "0" id = "showtable" style = "word-wrap: break-word; word-break: the break-all; table-layout: inherit:# > <th style = "text-align: center; width: 10%;"> number </th> <th align = "center" style = "text-align: center; width: 17%"> Название меню </th> <!-<th align = "center" style = "text-align: center"> Уровень меню </th> <th align = "center". align = "center" style = "text-align: center"> меню второго уровня </th>-> <th align = "center" style = "text-align: center; width: 18%"> Меню английское имя </th> <th align = "center" style = "text-align: center; width: 15%"> menu type </th> <th align = "style =" ytember = "ytelign =" ytember = " Центр; ширина: 20%">, отображается ли он </th> <th align =" center "style =" text-align: center; width: 20%"> операция </th> </tr> </thead> <tbody id =" data-list "style =" text-align: center; "> <%if (menuist! menuist.size (); i ++) {jsonObject json = menuist.getJsonObject (i); Меню меню = (меню) jsonobject.tobean (json.getjsonobject ("Menu"), Menu.class); %> <tr id = "<%= menu.getlevel ()%>"> <td id = "<%= menu.getmenuid ()%>"> <%= menu.getlevel ()%> </td> <td> <piv> <%= menu.getmenunam <div> <%= menu.getenmenuname () == null? "": menu.getenmenuname ()%> </div> </td> <!-<td> <viv> <%// if (menu.gethassecond () == 1) {%> Menu первого уровня <%//} else {%> ree-level men </td> <td> <div> <%// if (json.getString ("ischild"). equals ("1")) {%> <a href = "javascript: void (0)" rel = "verse nofollow" rel = "inoflowlogy" rel = "inoflow" onclick = "getChildMenu ('<%// menu.getMenuId ()%>')"> view </a> <%//} else {%> none <%//}%> </div> </td> -> <td> <%<%if (menu.getmenutyp if (menu.getmenutype () == 1) {%> text type <%} else {%> тип ссылки <%}%> </div> </td> <td> <%if (menu.getState () == 0) {%> <type = "onclick =" ChangeMeNustate ('%= menu.getName () %> ', < %= menu.getMenuid () %>, 1) "> show </button> <button type =" button "style =" founke: #eaeaea; color: #d0d0d0; "> Hide </button> < %} else { %> <button Type =" button "style =" founal: #eaea; onclick = "ChangeMeNustate ('<%= menu.getMenuname ()%>', <%= menu.getMenuid ()%>, 0)"> скрыть </button> <%}%> </td> <td> <%if (menu.getmenutype ()! = 0) {%> <div> <div style; href = "javaScript: void (0)" rel = "внешний nofollow" rel = "внешний nofollow" style = "color: red; ширина: 30px; дисплей: inline block;" id = "<%= menu.getmenuid ()%>"> </a> </div> <%}%> <%if (menu.getmenutype ()! = 0) {%> <div style = "float: right; right; nofollow "style =" color: красный; ширина: 30px; дисплей: inline block; " id = "<%= menu.getmenuid ()%>"> </a> </div> <%}%> </td> </tr> <%}} else {%> <Tr> <td colSpan = "6" Align = "Center"> нет данных. </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> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div style = "height: 50px; line-height: 50px;"> <div style = "display: none;"> <a href = "#" rel = "внешний nofollow" rel = "nofollow" rel = "внешний nofollow" rel = "внешний nofollow"> о США </a> | <a href = "#" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow"> weibo </a> | <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" nofollow "> блог </a> | <a href ="#"rel =" внешний nofollow "rel =" nofollow "rel =" noflowlow "rellow/nofollo -servelly" nofloill "relowllow 'rellow/noflolon" noflow (nofollow "rel =" nofollow ". <a href = "#" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow" rel = "внешний nofollow"> Политика конфиденциальности </a> </div> <p> incongress.com, все права защищены. type = "text/javascript"> </script> <script src = "/cvc/center/js/cached_lay_reports_cus.js" type = "text/javascript"> </script> <div id = "mask"> </div> <div id = "addlogo" Style = "Display: нет; z-Index: 12; ширина: 800px; высота: Auto; Margin-left: -50px;"> <div> <span style = "font-size: 16px; margin-left: 20px; color: #fff; Margin-top: -5px;" Id = "gn_title"> add Menu </span> <adod_ xomal ". </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" value = "< %= numb1 %>"> <input type = "hidden" name = "numb2" value = "< %= numb2 %>"> <input = "hidden" id = "menuid" = "valy =" value = "-1" <> <tailDer> <> <tailDer> <tald> <tald> <> <talder> <> <> <> "-1" > Имя меню </span> </td> <td> <input type = "text" id = "menu_name" name = "menuname" style = "margin: 10px 0px; display: inline block; рост: 34px;"/> <pan> </span> </td> </tr> <!-<td> <td> <td> <td> <td> <td> <td> <td> <td> <td> <td> <td> <td> <td> id = "menu_level" name = "menu_level" style = "margin: 10px 0px"> <vitue value = "-1"> Пожалуйста, выберите ... </option> <option value = "1"> меню первого уровня </option> <опция value = "2"> меню второго уровня </option> </selet> </span> </td> </tr TR идентификатор. none "> <Td> родительское меню: </td> <td> <select id =" menu_parent "name =" menu_parent "style =" margin: 10px 0px "> <опция value ="-1 "> Пожалуйста, выберите ... </option> </select> <pan> </span> </td> </td> </tr> <tr> <tr> <td> </td> </tr> <dr> <td> </td> </td> </tr> </tr> id = "menutype" name = "menutype" style = "margin: 10px 0px; display: inline block; width: 350px;"> <option value = "-1"> Пожалуйста, выберите ... </option> <опция Value = "1"> Тип картинки </option> <vition = "2"> тип Link> </select> </td> </trt> </trt> </trt> </trt> </trt> </trt> </trt> </trte> </trt> </trte> </trteme. Style = "Display: none"> <Td> Текстовое содержимое </td> <Td> <TextARea Rows = "45" Cols = "70" name = "menucontent" id = "menucontent" style = "display: inline-block;"> </textarea> </td> </td> <Tr Id = "Linktr"; В полном адресе внешней ссылки, который должен включать <span style = "color: red"> http: // </span> Например: http: //www.baidu.com </br> <input type = "text" id = "menuurl" name = "menuurl" style = "margin: 10px 0px"/> <span style = "margin: 10px 0px 0px 0px. </tr> <tr> <td align = "center" colspan = "2"> <hr style = "margin-bottom: 10px;"> <input id = "menu_add" type = "button" value = "add" style = "border-radius: 0; ширина: 260px; рост: 40px; margin: auto 50px; margin: 20px"//tr.>/tr.>/tr.>/std> <//////crow </form> </div> </div> </div> </div> <div id = "childmenu" style = "disploy: none; z-index: 12; ширина: 650px; рост: авто; маржа-слева: -325px;"> <div id = "childz"> <div style = "margin-top: -40px; 16px; margin-left: 20px; color: #fff "id =" gn_title "> меню второго уровня </span> <a id =" close_modal "> </a> </div> <div id =" RegisterDiv "> <Таблица сотовой связи =" 0 "style =" word-wrap: break-word; Word-Break: Break-All; Table-Layout: nehrit; "> <theade> <tr> <th style =" text-align: center "> № </th> <th align =" center "style =" text-align: center "> имя меню </th> <th Align =" center "style =" text-align: center "> menu Уровень </th> <the Align =" style-leven = "al-al-al-al-al-al-al-al-al-al-al-al-al-al-al-al. menu</th> <th align="center" style="text-align: center">Menu Type</th> <th align="center" style="text-align: center">Modify</th> <th align="center" style="text-align: center">Delete</th> </tr> </table> </div> </div> </div> <script type="text/javascript" src = "<%= path%>/cvc/center/js/my97datepicker/wdatepicker.js"> </script> <script src = "<%= path%>/cvc/center/js/fut.js" type = "text/javascript"> </script> <script src = "<%= path%>/cvc/center/js/validform_v5.3.2.js" type = "text/javascript"> </script> <script charset = "utf-8" src = "<%= path%>/train/js/prettify/kindeditor.js"> </script> <script warsed = "utf-8" src = "<%= path%>/train/js/prettify/lang/zh_cn.js"> </script> <script charset = "utf-8" src = "<%= path%>/train/js/prettify/plugins/code/prettify.js"> </script> <script type = "javascript" javccript "<%= </script> <script =" javascript ". %>/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> <cript charset =" utf-8 "js.11. src = "< %= path %>/center/js/jquery-ui.min.js"> </script> <script> var editor1; } else */if (menuname == "English") {alert («Пожалуйста, перейдите в базовую информационную модуль, чтобы установить текущую конференцию китайского и английского типа»); Успех: function (json) {if (json.state == 1) {window.location.reload (); // При выходе из выпуска анимации: Функция (Event, UI) {// Обновление категории сортировки = $ ("#showtable"). Сортушко $ (это). Children ("TD"). Уравнение (0) .html (level); $ (this) .Children ("TD") "Менуид:" +tdid; }); $ ("#menu_level"). val (); ! = null && result! = "" && result.length> 0) {for (var i = 0; i <result.length; i ++) {var option = "<option value = '"+result [i] .menuid+"'>"+result [i] .menuname+"</option>" console.log (опция) $ (##menu_parent); ALERT («Меню без уровня» еще не создано, создайте меню первого уровня перед созданием меню наушников »); $ ("#imgtexttr"). Show (); $ ("#addz"). css ("height", "180px")}}) // Добавить $ ("#menu_add"). Click (function () {var menuname = $ ("#menu_name"). val (); var menulevel = $ ("#menu_level"). val (); var menutype = $ ("#menu_level"). Menuurl = $ ("#menuurl"). == 1) {if ($ ("#menucontent"). Val (). Trim () == "" || $ ("#menucontent"). Val (). Trim (). Длина == 0) {alert ("Пожалуйста, заполните текст и содержимое текста"); || $ ("#Mask"). Hide (); $ (". tk1_header"). Click (function () {location.reload ();}) $ ("#close"). Click (function () {$ ("#zstype"). Val (0); $ ("#zshref"). Val (""); $ ("#mask"). Hide (); "#addlogo"). $ ("Body"). CSS ("Position", "static"); $ .ajax ({url: «<%= path%>/webcenter.do?getMenubyId», тип: «Get», data: «menuid =»+this.id, datatype: «json», успех: function (data) {$ ("#menu_name"). Val (data.menunam if (data.menutype == 1) {$ ("#imgtecttr"). Show (); $ ("#linktr"). Show ();код действия
@Requestmapping (params = "updateMenulevel", method = requestMethod.post) public void updateMenulevel (строковый меналист, httpservlectrequest, httpservletresponse response) {try {httpsession session = this.getSession (request); Adminuser adminuser = session.getAttribute ("centerAdminuser") == null? Null: (adminuser) session.getAttribute ("centerAdminuser"); if (adminuser == null) {try {response.sendredirect (request.getContextPath ()+"/center/index.jsp"); } catch (Exception e) {e.printstackTrace (); }} else {string conid = request.getSession (). getattribute ("conid") == null? null: request.getsession (). getattribute ("conid"). toString (); if (conid == null) {response.sendredirect (request.getContextPath ()+"/center/index.jsp"); } Jsonarray array = jsonarray.fromobject (меналистик); for (int i = 0; i <array.size (); i ++) {jsonObject json = array.getJsonObject (i); Menu Menu = webservice.getMeNubyid (json.getint ("Menuid")); menu.setlevel (json.getint ("level")); webservice.saveobject (меню); }}} catch (Exception e) {e.printstackTrace (); }Приведенный выше пример таблицы реализации Java T - это все контент, которым я поделился с вами. Я надеюсь, что вы можете дать вам ссылку, и я надеюсь, что вы сможете поддержать Wulin.com больше.