Fungsi Implementasi: Menerapkan Tabel T Menyeret dan Simpan Level Diubah Karena Seret.
Kode JSP
<Div ID = "MainContainer"> <div> <div id = "b_center"> <div id = "launch-detail-table"> <Div> <h2 style = "margin-bottom: 0px; margin-top: 0px; tinggi: 43px; line-height: 43px; id="addLG" type="button"> <img src="/center/images/btn_add.png">Add menu</button> </div> <br> <div> <table cellpacing="0" id="showTable" style="word-wrap: break-word; word-break: break-all;table-layout: inherit;background:#FFFFFF !important;"> <thead> <tr > <th style="text-align: center;width:10%;">number</th> <th align="center" style="text-align: center;width:17%">menu name</th> <!-- <th align="center" style="text-align: center">menu level</th> <th align="center" style="text-align: center">menu level</th> <th align="center" style = "text-align: center"> menu tingkat kedua </t>-> <th align = "center" style = "text-align: center; width: 18%"> menu nama bahasa Inggris </t> <tH align = "center" style = "Text-align: center; width: 15%"> Tipe menu </th </th </th align = "apakah itu center; <tH align = "center" style = "text-align: center; width: 20%"> Operation </th> </tr> </thead> <tbody id = "data-list" style = "text-align: center;"> <% if (int i = 0; null && menulist.size ()> 0) {untuk (int i = 0; menulist.getjsonObject (i); Menu menu = (menu) jsonobject.tobean (json.getjsonObject ("menu"), menu.class); %> <tr id = "<%= menu.getlevel ()%>"> <td id = "<%= menu.getMenuid ()%>"> <%= menu.getlevel ()%> </td> <td> <%= menu.getMenuname ()%> </div> </td> <%= menu.getMename ()% <verv> <%= menu.geteNMenuname () == null? "": menu.geteNMenuname ()%> </div> </td> <!-<td> <verv> <%// if (menu.gethassecond () == 1) {%> menu tingkat pertama <%//} {%> level> {%> menu tingkat pertama <%//} {%> {%> {%> {%> {%> {%> {%> <%/} {%level {%> {%> {%> {%/{%> <div> <%// if (json.getString ("ischild"). sama ("1")) {%> <a href = "javascript: void (0)" rel = "nofollow eksternal" rel = "nofollow eksternal" rel = "eksternal nofollow external" OnClick = "getChildMenu ('<%// menu.getMenuid ()%>')"> view </a> <%//} else {%> tidak ada <%//}%> </div> </td> -> <td> <vip> <%if if (menu.getMeNutype () == 0) {%{%{%ife> 1) {%> Tipe Teks <%} else {%> Tipe tautan <%}%> </div> </td> <td> <%if (menu.getState () == 0) {%> <Tombol typed = "TOLOGTED" ONCLick = "ChangeMenustate ('<%= menu.getMenuname ()", <%= ", <%=", <%.) <) <%= Menu = menu. type = "Tombol" style = "latar belakang: #eaeaea; warna: #d0d0d0;"> sembunyikan </button> <%} else {%> <tombol type = "tombol" style = "latar belakang: #eaeaea; warna: #d0d0d0;"> tunjukkan </button> <tombol type = "tombol") (ontclick = "angkanSUSTATE ('%= ompane) <kuton = tombol (MOTONDEME (MOGTEME) (MONEMEMETE (TOMBOLETE (TOMBOLETE (TOMBOLETE (TOMBOLETE (TOLUMEAEA. %> ', <%= menu.getMenuId ()%>, 0) "> sembunyikan </button> <%}%> </td> <td> <%if (menu.getMenutype ()! = 0) {%> <Div> <div style =" float: right; margin-right: 10px; "> <div> <div style =" float: right; margin-right: 10px; "> <a href =" JAUV = "JAUV =" JAUV = 0) (10px; "> <a href =" JAV = "JAV =" JAV = 0) (10px; "> <a href =" JAUV = " Rel = "Eksternal 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 (0)" rel = "External" nowlowe "nowlowe" nowlowe "nnal" external "external" external "external" nowlowe "nowl overl ollow" nref ollow "nref ollow" nref ollow " nofollow "style =" warna: merah; lebar: 30px; display: inline-block; " id = "<%= menu.getMenuId ()%>"> </a> </div> <%}%> </td> </tr> <%}} else {%> <tr> <td colspan = "6" align = "center"> belum ada data </tu- td> </tang> </ttr> </ttr> </ttr> </tod> </tod> </tod> </tod> </tod> </tod> </tod> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div style = "Tinggi: 50px; line-height: 50px;"> <div style = "display: none;"> <a href = "#" rel = "eksternal nofollow" rel = "nofollow eksternal" rel = "eksternal nofollow" rel = "eksternal nofollow"> tentang kita </a> | <a href = "#" rel = "nofollow eksternal" rel = "eksternal nofollow" rel = "eksternal nofollow" rel = "nofollow eksternal" rel = "nofollow eksternal"> 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 = "nofollow eksternal" rel = "eksternal nofollow" rel = "eksternal nofollow" rel = "eksternal nofollow" rel = "eksternal nofollow" rel = "nofollow eksternal" rel = "nofollow eksternal" rel = "eksternal" nofollow = "noffollow eksternal" rel = "nofover eksternal" nofower "nofower = nofower eksternal" nofower external nofolly <a nofower " nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Terms of Service</a> | <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >Privacy Policy</a> </div> <p>Incongress.com, All Rights Dicadangkan. <span> </span> </p> </div> <script src = "/cvc/center/js/cacached_lay_reports.js" type = "text/javascript"> </script> <cript src = "/cvc/center/js/js/cached_lay_corts_cus." id = "mask"> </div> <div id = "addlogo" style = "display: none; z-index: 12; lebar: 800px; tinggi: auto; margin-left: -50px;"> <div> <span style = "font-ukuran: 16px; margin-left: 20px; color: #TFFFFFffffffffff; margin-t margin; menu</span> <a id="close_modal">×</a> </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 =" hiding "name =" numb2 "value =" %= numb2 = "hidput" name = "numb2" value = " %= numb2 =" hidput "name =" numB2 "value =" %= "numb2 name = "menuId" value = "-1"> <ables> <tr> <td> <span> Nama menu </span> </td> <td> <input type = "text" id = "menu_name" name = "menuname" style = "tR> </ttr> </ttran </td-block; Tinggi; 34px;" <td> Menu Level: </td> <td> <select id="menu_level" name="menu_level" style="margin:10px 0px"> <option value="-1">Please select...</option> <option value="1">First level menu</option> <option value="2">Second level menu</option> </select> <span></span> </td> </tr> <tr id = "menu_parent_tr" style = "Display: none"> <td> menu induk: </td> <td> <pilih id = "menu_parent" name = "menu_parent" style = "margin: 10px 0px"> </span value = "-1"> Pilih ... </option> </pilih </TR/TR/TR/TR/TR/TR/TR/TR/TR/TR. type</td> <td> <select id="menuType" name="menuType" style="margin:10px 0px;display:inline-block;width:350px;"> <option value="-1">Please select...</option> <option value="1">Picture type</option> <option value="2">link type</option> </select> </td> </tr> <tr id = "imgtexttr" style = "display: none"> <td> konten teks </td> <td> <textarea rows = "45" cols = "70" name = "menucontent" id = "menucontent" style = "display: inline-block;"> </textArea> </td> </td> </td "no link =" linker = "TRAYP ="> </TextArea> </t/td> </td> </td "no link =" link = "link =" TRAY = "TRADET" TRAY = " Alamat </td> <td> Harap isi alamat tautan eksternal lengkap, yang harus mencakup <span style = "color: red"> http: // </span> misalnya: http: //www.baidu.com </br> <input type = "text" id = "menuUrl" name = "menuUrl" style = "margin: 10p: 10p =" SPARX "name =" MARLEURL "MARGIN: MARGIN; 0px "> </span> </td> </tr> <tr> <td align =" center "colspan =" 2 "> <hr style =" margin-bottom: 10px; "> <input id =" menu_add "type =" button "value =" add "style =" border-radius: 0; width: 260px; Button "value =" add "style =" border-radius: 0; width: 260px; 50px; margin: 20px "/> </td> </tr> </able> </form> </div> </div> </div> </div> <div id =" childmenu "style =" display: none; z-index: 12; lebar: 650px; tinggi: auto; auto; margin-left: -325px: 650px; tinggi: auto; auto; margin-left: -325px; style = "margin-top: -40px;"> <span style = "font-size: 16px; margin-left: 20px; color: #fff" id = "gn_title"> menu tingkat kedua </span> <a break = "close_modal"> </a> </div> <div id = "registerDiv"> cell = "0 TABLE" </a> </div> <div id = "registerdiv"> cell = "0 TABLE" = 0 TABLE "0 Word-Break: Break-all; tabel-tabel: warisan; "> <Thead> <tr> <th style =" Text-align: center "> Number </th> <th align =" center "style =" text-align: center "> name menu <" levever = "center =" Text-align: center "> Menu level </t> <tH Align =" center = "Text-align: center"> menu level </th> tH: tHever = "center" haup "text-align: center"> menu level </th> tH: tHever = "center" haup "text-align: center"> Menu level </th> tH: tHever = "center" style "text-align: center"> menu level </th> 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/pengaturan. src = "<%= path%>/cvc/center/js/validform_v5.3.2.js" type = "text/javaScript"> </script> <script charset = "utf-8" src = "<%= path%>/train/js/prettify/uTfieditor.js"> </%script> skrip = " src = "<%= path%>/train/js/prettify/lang/zh_cn.js"> </script> <skrip charset = "utf-8" src = "<%= path%>/train/js/prettify/plugins/code/prettify.js" </script> <script = "TEKP/JAV/JAV/JAV =" SCRIPT/JAV = "JAV =" JAV/JAV/JABS/JAVE/JAVE/JAVE/JAVE/JABS/PLUTTIFE/JACK = %>/cvc/center/js/jQuery-1.10.2.min.js "> </script> <skrip charset =" utf-8 "type =" text/javaScript "src =" < %= path %>/cvc/center/js/jQuery-"UT" fex = JS/JSCRIP/JSCRIP = "TEPP =" TEPP = "TEPP/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS/JS = SRC = "< %= Path %>/Center/JS/JQuery-UI.Min.js"> </script> <script> var editor1; */if (menuname == "bahasa Inggris") {alert ("Silakan pergi ke modul informasi dasar untuk mengatur konferensi sekarang jenis bahasa Cina dan bahasa Inggris"); if (json.state == 1) {window.location.reload (); stop: event, ui) {// Setelah memperbarui var CategoryIDS = $ ("#showtable"). Sortable ("ToArray"); }) level = 0; var content = "["; 1) Konten = "{level:" URL: "<%= Path%>/WebCenter.do?upDateMenulevel", ketik: "Posting", DataType: "JSON", Data: "Menulist ="+Konten, Sukses: Fungsi (JSON) {}})}}); $ ("#menu_level"). ubah (function () {$ ("#menu_parent"). kosong (); $ ("#menu_parent"). append ("<option value = '-1'> Pilih ... </option>") level = $ ("#menu_Level"). Val (); if (level == 1) {{{$ "; 2) {$ .AJAX ({url: "<%= path%>/webcenter.do?getFirstMenu", ketik: "get", DataType: "json", Success: function (hasil) {if (var i = 0; i hasil. value = '"+hasil [i] .menuid+"'> "+hasil [i] .menuname+" </tiption> "console.log (opsi) $ ("#menu_parent "). Tambahkan (opsi);}} else {" belum ada menu level}}}}}}}}}}. }}) // Pilih tipe grafik $ ("#menutype"). Ubah (fungsi () {if ($ ("#menutype"). Val () == 1) {$ ("#imgtexttr"). Tampilkan (); $ ("#linktr"). Hide (); $ ("#addz"). if ($ ("#menutype"). Val () == 2) {$ ("#imgtexttr"). Hide (); $ (#menu_name "). Val (); false; konten "); return false;}} if ($ ("#menutype "). val () == 2) {if (menuUrl.trim () ==" "|| menuUrl.trim (). Length == 0) {alert (" Harap masukkan alamat lompatan "); return false;}} var menucount = <%= menulissize%"); return false;}} var menucount = <%= menulissize% $ (#menuID "). Val () == -1) {alert (" Menu hanya dapat ditambahkan hingga sembilan "); $ ("#addlg"). Klik (function () {$ ("#mask"). Show (); $ ("#addlogo"). Show ();}) // batal $ (". $ (#zshref "). Val (" "); $ ("Addlogo"). Show (); $ ("Body"). CSS ("Posisi", "Fixed"); Sukses: data) {$ ("#menu_name"). Val (data.Menuname); editor1.html (data.content); }}%>kode tindakan
@RequestMapping (params = "UpdateMenulevel", Method = requestMethod.post) public void updateMeNulevel (String Menulist, httpservletRequest Request, httpservletResponse response) {coba {httpsession sesi = this.getSession (request); AdminUser AdminUser = session.getAttribute ("centerAdminuser") == null? Null: (adminuser) session.getAttribute ("centerAdminuser"); if (adminuser == null) {coba {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 (menulist); untuk (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 (menu); }}} catch (Exception e) {e.printstacktrace (); }Contoh Tabel Implementasi Java di atas t seret adalah semua konten yang telah saya bagikan dengan Anda. Saya harap Anda dapat memberi Anda referensi dan saya harap Anda dapat mendukung wulin.com lebih lanjut.