加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java实现表格tr拖动的实例(分享)

发布时间:2020-05-23 18:07:53 所属栏目:Java 来源:互联网
导读:实现功能:实现表格tr拖动,并保存因为拖动改变的等级.jsp代码divid="mainContainer"

实现功能:实现表格tr拖动,并保存因为拖动改变的等级.

jsp代码

<div id="mainContainer">
     <div class="contentCol">
      <div id="b_center">
       <div class="mod mod1 parent-table" id="launch-detail-table">
         <div class="mod-header radius">
          <h2 style="margin-bottom:0px;margin-top:0px;height:43px;line-height:43px;">
           菜单管理   
          </h2>
          <span style="color:red">请使用拖拽调整排列顺序</span>
          <button id="addLG" type="button" class="czbtn add_class" style="width:140px;margin-left:20px;">
          <img alt="" src="/center/images/btn_add.png">   添加菜单</button>
         </div>
         <br>
         <div class="mod-body">
          <table class="data-load-2 appgrouping" width="100%" border="0"
           cellspacing="0" id="showTable"
           style="word-wrap: break-word; word-break: break-all;table-layout: inherit;background:#FFFFFF !important;">
           <thead>
            <tr class="first_tr" >
             <th class="first" width="50" style="text-align: center;width:10%;">编号</th>
             <th width="400" align="center" style="text-align: center;width:17%">菜单名称</th>
             <!-- <th width="160" align="center" style="text-align: center">菜单级别</th>
             <th width="80" align="center" style="text-align: center">二级菜单</th>-->
             <th width="100" align="center" style="text-align: center;width:18%">菜单英文名称</th>
             <th align="center" style="text-align: center;width:15%">菜单类型</th>
             <th align="center" style="text-align: center;width:20%">是否显示</th>
             <th width="210" align="center" style="text-align: center;width:20%">操作</th>
            </tr>
           </thead>
          
           <tbody id="data-list" style="text-align: center;">
            <%
             if (menuList != null && menuList.size() > 0) {
               for (int i = 0;i < menuList.size();i++) {
               JSONObject json = 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>
              <div class="menuName"><%=menu.getMenuName()%></div>
             </td>
             <td>
              <div class="menuName"><%=menu.getEnMenuName()==null?"":menu.getEnMenuName()%></div>
             </td>
             <!-- <td>
              <div class="menuLevel"><%//if(menu.getHasSecond() == 1){%>一级菜单<%/

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读