jQuery中table數(shù)據(jù)值的拷貝和拆分-創(chuàng)新互聯(lián)

本篇內(nèi)容介紹了“jQuery中table數(shù)據(jù)值的拷貝和拆分”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

創(chuàng)新互聯(lián)建站于2013年創(chuàng)立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元河北做網(wǎng)站,已為上家服務(wù),為河北各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792

在開(kāi)發(fā)的過(guò)程中,經(jīng)常會(huì)遇到彈出框顯示前一頁(yè)table列表的情況,這時(shí)候會(huì)有好多方法來(lái)來(lái)解決,有的人可能會(huì)說(shuō)重新查一遍數(shù)據(jù)顯示,有的人會(huì)說(shuō)直接用js將值拷貝過(guò)去,然后再修改,不過(guò)現(xiàn)在就介紹怎么用jquery將值拷貝到第二頁(yè)并拆分拷貝的值。

      母頁(yè)顯示數(shù)據(jù)格式如下:

 <div class="materialCode stdtable">
      <h3>發(fā)貨情況</h3>
      <ul class="theadUl clearfix">
        <li class="td1">發(fā)貨批次</li>
        <li class="td2">商品</li>
        <li class="td3">發(fā)貨數(shù)量</li>
        <li class="td4">剩余數(shù)量</li>
        <li class="td5">收貨數(shù)量</li>
        <li class="td6">收貨狀態(tài)</li>
        <li class="td7">操作</li>
      </ul>
      <table id="table1">
        <thead>
          <tr>
            <th class="td1"></th>
            <th class="td2"></th>
            <th class="td3"></th>
            <th class="td4"></th>
            <th class="td5"></th>
            <th class="td6"></th>
            <th class="td7"></th>
          </tr>
        </thead>
        <tbody>
        <c:forEach var="deliverGoodsList"
           items="${orderDetail.deliverGoodsList}" varStatus="outer">
          <c:forEach var="deliverGoodsDetaiList"
                items="${deliverGoodsList.deliverGoodsDetaiList}" varStatus="inner">
          <tr flag="${deliverGoodsList.deliverGoodsId}" orderId="${deliverGoodsList.orderId}" goodsId="${deliverGoodsDetaiList.goodsId}">
            <c:if test="${inner.index == 0}">
              <td rowspan="${deliverGoodsList.deliverGoodsDetaiList.size()}">${outer.index+1}</td>
            </c:if>
              <td>
                <div class="ord_product"><img src="${deliverGoodsDetaiList.goodsImage}">
                  <div>
                    <c:if test="${orderDetail.orderForm.orderType =='2' }">
                      <h6><a href="javascript:void(0);" rel="external nofollow" >${deliverGoodsDetaiList.goodsName}</a></h6>
                    </c:if>
                    <c:if test="${orderDetail.orderForm.orderType !='2' }">
                      <h6><a href="${URL_WWW}/shop/index.php?act=goods&goods_id=${deliverGoodsDetaiList.goodsId}" rel="external nofollow" >${deliverGoodsDetaiList.goodsName}</a></h6>
                    </c:if>
                  </div>
                </div>
              </td>
              <td>${deliverGoodsDetaiList.deliveryNum}</td>
              <td>${deliverGoodsDetaiList.overplusNum}</td>
              <td>${deliverGoodsDetaiList.takeDeliveryNum}</td>
              <c:if test="${inner.index == 0}">
                <td rowspan="${deliverGoodsList.deliverGoodsDetaiList.size()}">
                <c:if test="${deliverGoodsList.deliveryStatus =='10' }">
                  待發(fā)貨
                </c:if>
                <c:if test="${deliverGoodsList.deliveryStatus =='20' }">
                  待確認(rèn)收貨
                </c:if>
                <c:if test="${deliverGoodsList.deliveryStatus =='30' }">
                  已收貨
                </c:if>
                <c:if test="${deliverGoodsList.deliveryStatus =='40' }">
                  退貨
                </c:if>
                </td>
              </c:if>
            <c:if test="${inner.index == 0}">
              <td rowspan="${deliverGoodsList.deliverGoodsDetaiList.size()}"><a href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="pr beizhu">查看備注
               <div class="beizhu_msg beizhu_msg_li" >
                      <img src="${URL_LIB}/static/order/images/sanjiao_orange.png">
                      <p>${deliverGoodsList.logisticsRemark}</p>
               </div>
              </a>
                <c:if test="${deliverGoodsList.deliveryStatus !='30' }">
                 <input type="button" name="" value="確認(rèn)收貨" class="dayin" onclick="showDeliver(${deliverGoodsList.deliverGoodsId})" >
                </c:if>
              </td>
            </c:if>
            <%--<td>${deliverGoodsDetaiList.goodsId}</td>--%>
            </c:forEach>
          </tr>
        </c:forEach>
        </tbody>
        <c:if test="${empty orderDetail.deliverGoodsList}">
            <tbody>
            <tr class="opt_zanwu">
              <td colspan="7">暫無(wú)發(fā)貨信息</td>
            </tr>
            </tbody>
        </c:if>
      </table>
    </div>
    </div>

如下是彈出框顯示頁(yè):

<div id="messageBoxWin" class="popup" >
    <div class="title">
      <h3>確認(rèn)收貨數(shù)量</h3>
      <div>
        <a class="min" href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" title="最小化" ></a>
        <a class="max" href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" title="大化" ></a>
        <a class="revert" href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" title="還原" ></a>
        <a class="close" href="javascript:;" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" title="關(guān)閉"></a>
      </div>
    </div>
    <div class="content" >
      <div >
        <table class="recieveCount">
          <thead>
          <tr>
            <th class="td1 ">發(fā)貨批次</th>
            <th class="td2 ">商品</th>
            <th class="td3 ">發(fā)貨數(shù)量</th>
            <th class="td4 ">剩余</th>
            <th class="td5 ">收貨數(shù)量</th>
          </tr>
          </thead>
          <tbody>
          <tr>
            <td colspan="8" >請(qǐng)仔細(xì)核對(duì)收貨數(shù)量后確認(rèn)</td>
          </tr>
          <%--<input type="button" name="" value="確認(rèn)" class="ordSure_btn" onclick="comformDeliver(${deliverGoodsList.orderId},${deliverGoodsList.deliverGoodsId})">--%>
          <%--<input type="button" name="" value="取消" class="ordSure_btn" >--%>
          </tbody>
        </table>
      </div>
      <div class="bot_btns" >
        <div class="ordSure_btn"  onclick="comformDeliver()">確定</div>
        <div class="ordCancel_btn" >取消</div>
      </div>
    </div>
  </div>
  </div>

如下為jquery代碼顯示:

 function showDeliver(deliverId){
      var delitems= $("#table1 tr[flag='"+deliverId+"']").clone();
      $(delitems).each(function(index){
        if(index==0){
          $($(this).find("td")[6]).remove();
          $($(this).find("td")[5]).remove();
          var deliverNum = $($(this).find("td")[2]).text(); 
          var inputHTML="<input type='text' onblur='checkAcount(this);' class='sum' value='"+deliverNum+"'>"
          $($(this).find("td")[4]).empty();
          $($(this).find("td")[4]).append(inputHTML);
        }else{
          var deliverNum= $($(this).find("td")[1]).text();
          var inputHTML="<input type='text' onblur='checkAcount(this);' class='sum' value='"+deliverNum+"'>"
          $($(this).find("td")[3]).empty();
          $($(this).find("td")[3]).append(inputHTML);
        }
      });
      $("#messageBoxWin table tbody").empty();
      $("#messageBoxWin table tbody").append(delitems);
      deliverGoodsId=deliverId;
    }

“jQuery中table數(shù)據(jù)值的拷貝和拆分”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站muchs.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

網(wǎng)站欄目:jQuery中table數(shù)據(jù)值的拷貝和拆分-創(chuàng)新互聯(lián)
本文來(lái)源:http://muchs.cn/article48/hepep.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、標(biāo)簽優(yōu)化、ChatGPT移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站收錄、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司