実装関数:テーブルTドラッグを実装し、ドラッグによりレベルを保存します。
JSPコード
<div id = "maincontainer"> <div> <div id = "b_center"> <div id = "launch-detail-table"> <div> <h2 style = "margin-bottom:0px; margin-top:0px; height:43px; line-height:43px;"> menu management </h2> <スパンスタイル= < id = "addlg" type = "button"> <img src = "/center/images/btn_add.png"> add menu </button </button> </div> <br> <div> <table cellpacing = "0" "id =" showtable "stiled =" word-wrap; break-word-break:break-layot; < <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-align ">メニューレベル</th <th <th <th mence =" lign: "align" style = "text-align:center">セカンドレベルのメニュー</th> - > <th align = "center" style = "text-align:center; width:18%">メニュー英語名</th aLign = "center" style = "text-align; width:15%">メニュータイプ</th> <th lot "表示</th> <th align = "center" style = "text-align:center; width:20%">操作</th> </tr> </thead> <tbody id = "data-list" style = "text-align;"> <%if(menulist!= null && menulist.size()> 0){ jsonobject json = menulist.getjsonobject(i);メニューメニュー=(メニュー)jsonobject.tobean(json.getjsonobject( "menu")、menu.class); %> <tr id = "<%= menu.getLevel()%>"> <td id = "<%= menu.getmenuid()%>"> <%= menu.getLevel()%> </td> <td> <%= menu.getmenuname()%> </div> </td> <td> <td> < <div> <%= menu.getEnmenuname()== null? "":menu.getenmenuname()%> </div> </td> <! - <td> <div> <%// if(menu.gethassecond()== 1){%>ファーストレベルメニュー<%// <td> <div> <%// if(json.getString( "ischild")。equals( "1")){%> <a href = "javascript:void(0)" rel = "external nofollow" rel = " onclick = "getChildMenu( '<%// menu.getMenuid()%>')"> view </a> <%//} else {%> none <%//}%> </div> </td> - > <td> <div> <%if(menu.getmenutype()= = {%> systemタイプ} 1){%>テキストタイプ<%} else {%> link type <%}%> </div> </td> <td> <%if(menu.getState()== 0){%> <ボタンタイプ= "button" onclick = "changemenustate( '<%= menu.getmenuname()% type = "button" style = "background:#eaea; color:#d0d0d0;"> hide </button> <%} else {%> <button type = "button" style = "background:#eaea; color:#d0d0d0;" %> '、<%= menu.getMenuid()%>、0) ">非表示</button> <%}%> </td> <td> <%if(menu.getmenutype()!= 0){%> <div>" float:right; margin-right:10px; "> <a href =" javascript: "") rel = "外部nofollow" style = "color:red; width:30px; display:inline-block;" id = "<%= menu.getMenuid()%>"> </a> </div> <%}%> <%if(menu.getmenutype()!= 0){%> <div style = "float:right; margin-right:10px;"> <a href = "javascript:void(void( nofollow "style =" color:red; width:30px; display:inline-block; " id = "<%= menu.getMenuid()%>"> </a> </div> <%}%> </td> </tr> <%}} </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 =" returation nofollow "rel =" external nofollow "rel =" <a href = "#" rel = "external nofollow" rel = "external nofollow" rel = "returation nofollow" rel = "external nofollow" rel = "external 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 = "returation nofollow" rel = "returation nofollow" rel = "returation nofollow" rel = "external nofollow" rel = "returation nofollow" returante nofollow "rel =" external nofollow "rel =" external nofollow "rel =" external nofollow "nofolow"> ">"> " nofollow "rel =" external nofollow "rel =" external nofollow "rel =" external nofollow ">利用規約</a> | <a href ="# "rel =" returation nofollow "rel =" returation nofollow "rel =" external nofollow "rel =" external nofollow "> privacy </a> </div <p> <p> <p予約id = "mask"> </div> <div id = "addlogo" style = "display:none; z-index:12; width:800px; height; auto;"> <div> <span style = "メニュー</span> <a id = "close_modal">×</a> </div> <div id = "addz"> <div id = "Registerdiv"> <form id = "menuform" method "post" action = "<%= path% value = "1"> <input type = "hidden" name = "conid" value = "<%= conid%>"> <input type = "hidden" name = "numb1" value = "<%= numb1%>"> <入力タイプ= "hidden" name = "numb2" value = "<%= numb2%>"> <input = "id" id = "" meneid " <td> <span>メニュー名</span> </td> <td> <入力タイプ= "text" id = "menu_name" name = "menuname" style = "margin:" mirgn: "display:inline-block; height:34px;"/> <span> </span> </td> </td> <! id = "menu_level" name = "menu_level" style = "margin:10px 0px"> <option value = "-1">選択してください... </option> <option menu </option menu> <option> <option value = "2" <td>親メニュー:</td> <td> <id = "menu_parent" name = "menu_parent" style = "margin:10px 0px"> <option value = "-1"> </option> </select> </span> </td> </td> </tr> name = "menutype" style = "margin:10px 0px; display:inline-block; width:350px;"> <option value = "-1"> </option> <option value = "1"> picture type> <option value> <"2"> link type </option> </select> </tr <tr <tr <tr <td> <tr <td> </section = "> </select =コンテンツ</td> <td> <textarea rows = "45" cols = "70" name = "menucontent" id = "menucontent" style = "display:inline-block;"> </textarea> </td> </td> <tr id = "linktr" style = "inctrube none < style = "color:red"> http:// </span>例:http://www.baidu.com </br> <入力タイプ= "text" id = "nemurl" style = "mirgan:10px 0px"/> <span style = ""マージン:10px " colspan = "2"> <hr style = "margin-bottom:10px;"> <input id = "mene_add" button "value =" style = "border-radius:0; width:260px; height; height; height; height:40px; margin:auto 50px; margin:20px"/>> </td> </div> </div> </div> </div> </div> </div> </div> <div id = "childmenu" style = "display:none; z-index:12; width:650px; height:auto; margin-left:-325px;"> <div id = "childz"> <div style = "div-top:-40px;"> <span style = "font-size:16px; color-left; id = "gn_title">セカンドレベルのメニュー</span> <a id = "close_modal"> </a> </div> <div id = "registerdiv"> <table cellpacing = "0" style = "word-rap:break-word;ワードブレイク:ブレークオール;テーブルレイアウト:継承; "> <thead> <tr> <th style =" text-align:center "> number </th align =" center "style =" text-align:center ">メニュー名</th> <th align =" center "style =" text-align: "center">メニュー "メニュー</th> <th align = "center" style = "text-align:center-align">メニュータイプ</th> <th align = "center" style = "text-align:center"> modify </th align = "center" style = "text-align:center"> delete </th> </tr </table> src = "<%= path%>/cvc/center/js/my97datepicker/wdatepicker.js"> </script> <スクリプトsrc = "<%= path%>/cvc/center/js/sett.js" type = "text/javascript"> </script src = "<%= path%>/cvc/center/js/validform_v5.3.2.js" type = "text/javascript"> </script> <script charset = "utf-8" src = "<%= path% src = "<%= path%>/train/js/prettify/lang/zh_cn.js"> </script> <script charset = "utf-8" src = "<%= path%>/train/js/prettify/plugins/code/prettife.js"> </script = "text/javascript/javascript" <%path %>/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 " src = "<%= path%>/js/jquery-ui.min.js"> </script> <script> var editor1; */if(menuname == "English"){alert( "現在の会議中国語と英語のタイプを設定するために基本的な情報モジュールに移動してください");成功:json){json.state == 1){windocy.location.reload(); True、//アニメーション停止を追加する://ソートVAR CATERIDS = $( "#showtable")。 $( "td")。html(revel); $( "td")。attr( "id"); "、" +tdid += "}}} }); $ $( "#showTable")。 $( "#menu_level")。val(); null && result!= "" && result.length> 0){for(var i = 0; i <result.length; i ++){var option = "<option value = '"+result [i] .menuid+"'>"+resultレベルメニューはまだ作成されています。ヘッドフォンメニューを作成する前に最初のレベルメニューを作成してください ");}}})$("#menu_parent_tr ")。 $( "#linktr")。$( "#addz")。 })// $( "#menu_add")。クリック(function(){var menuname = $( "#menu_name")。val(); var menulevel = $( "#menu_level")。val(); var menutype = $( "#menutype")。 || menuname() $(#menucontent ")。 } var menucount = menulistsize> = 19 && $()== -1) $( "body")。css( "position"、 "sixed");/ popt-up $( "#addlg")。 $( "#close")。クリック(function(){$( "#zStype")。val(0); $( "#zshref")。val( ""); $( "#mask")。hid() $( "。mer_mod")。クリック(function(){$( "#mask")。show(); $( "#addlogo")。show( "body")。タイプ: "get"、data: "menuid ="+this.id、 "json"、cuscess:function( "#menu_name")。 $( "#linktr")。$ $( "#addz")。 $( "#addz")。css( "height"、 "80px")}})})})})</script> </body> </html> <%}}%>アクションコード
@RequestMapping(params = "updatemenulevel"、method = requestmethod.post)public updatemenulevel(string menulist、httpservletrequest request、httpservletResponse応答){try {httpsession session = this.getSession(request); adminuser adminuser = session.getattribute( "centeradminuser")== null?null :( adminuser)session.getattribute( "centeradminuser"); if(adminuser == null){try {respons.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){respons.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実装テーブルTドラッグの上記の例は、私があなたと共有したすべてのコンテンツです。参照を提供できることを願っています。wulin.comをもっとサポートできることを願っています。