zoukankan      html  css  js  c++  java
  • jQuery中选中行

    <table id="tables" class="listTable">
                    <tr>
                        <th class="check">
                            <input type="checkbox" class="allCheck" />
                        </th>
                       
                        <th>
                            <a href="#" hidefocus>xx</a>
                        </th>
                        <th>
                            <a href="#" hidefocus>xx</a>
                        </th>
                       
                       
                        <th>
                            <a href="#" hidefocus>xx</a>
                        </th>
                    ...
                        <th>
                            <span>操作</span>
                        </th>
                    </tr>
                    <#list xx.xx as xx>
                        <tr style="text-align:center">
                            <td>
                                <#if xx.xx>
                                    <input type="checkbox" name="xx" value="${xx.id}" disabled/>
                                    <#else>
                                    <input type="checkbox" name="xx" value="${xx.id}" />
                                </#if>
                               
                            </td>
                            <td></td>
                            <td></td>
                            <td name="sex"></td>
                            <td name="phone"></td>
                            <td></td>
                            <td>
                                
                            </td>
                            <td></td>
                            
                            <td></td>
                            <td></td>
                            <td>
                                <input type="checkbox" name="name" value="${name}"  hidden="hidden"/>
                                <#if xx.xx><span  class="trueIcon">&nbsp;</span><#else><span class="falseIcon"></span></#if>
                            </td>
                            
                            <td>
                                <@sec.authorize ifAnyGranted="ROLE_DELIVERY_CENTER_EDIT">
                                <a href="xx!xx.xx?id=${xx.id}" title="编辑">[编辑]</a>
                                </@sec.authorize>
                            </td>
                        </tr>
                    </#list>
                </table>

     

    var isRecomms = [];
      
    var Check = $("table input[type=checkbox]:checked");
    Check.each(function () {
        var row = $(this).parent("td").parent("tr");//获取选中行
        isRecomms .push(row.find("[name='sex']").val());
        isRecomms .push(row.find("[name='phone']").html());
        isRecomms .push(row.find("[name='Name']").html());
    });
  • 相关阅读:
    .Net Core 微服务学习一
    微服务学习一
    软件开发基本接口学习二
    浏览器根对象window之操作方法
    浏览器根对象window之caches
    Angular面试题三
    浏览器根对象window之performance
    Angular面试题二
    浏览器根对象window之screen
    浏览器根对象window之history
  • 原文地址:https://www.cnblogs.com/chentexi/p/12459707.html
Copyright © 2011-2022 走看看