在我的表中未启用排序 [英] Sorting not enable in my table

查看:123
本文介绍了在我的表中未启用排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新了下面的代码,无法对表进行排序。
我试过tablersorter但这不帮助

I have updated the code in below fiddle, unable to sorting the table. I have tried tablersorter but thats not help

请解决m问题。

这是链接:jsfiddle.net/BKgue/224 /

Here is the link : jsfiddle.net/BKgue/224/

我更新了下面的代码。

I have updated the code below.

我的代码:

<head>
<title>Untitled Document</title>
<body>
<link rel="stylesheet" href="../../Downloads/mine/jQueryMobile_resources/jquery.mobile-1.3.0.min.css" type="text/css">
<script type="text/javascript" src="../../Downloads/mine/jQueryMobile_resources/jquery-1.9.1.min.js"></script> 
<script type="text/javascript" src="../../Downloads/mine/jQueryMobile_resources/jquery.mobile-1.3.0.min.js"></script> 


<script type="text/javascript" src="js/jquery.tablesorter.js" ></script> 
<script type="text/javascript" src="js/jquery.jquery.tablesorter.min.js" ></script> 
<script type="text/javascript" src="js/jquery.jquery-latest.js" ></script> 
<script type="text/javascript" src="js/jquery.jquery.metadata.js" ></script> 


<script type="text/javascript"> 
$(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 

</script>


</head>
                         <table data-role="table" id="table-column-toggle" class="ui-body-d ui-shadow table-stripe ui-responsive" data-column-btn-theme="b" >
                         <thead>
                           <tr>
                             <th data-priority="1">
                                 <label>
                                     <input type="checkbox" name="checkbox-0 "/>
                                 </label>
                             </th>
                             <th data-priority="2">CUSTOMER</th>
                             <th data-priority="3">SUBJECT</th>
                             <th data-priority="4">STATUS</th>
                             <th data-priority="5">UPDATED</th>
                             <th data-priority="6">ASSIGNED</th>                         
                             <th data-priority="7">PRIORITY</th>
                           </tr>
                         </thead>

                         <tbody>                            


                                <tr>
                                 <td>
                                    <label>
                                        <input type="checkbox" name="checkbox-0 "/>
                                    </label>
                                </td>
                                 <td>Smith</td> 
                                <td>Sampletitme</td> 
                                <td>open</td> 
                                <td>Yes</td> 
                                <td>me</td> 
                                    <td>me</td> 
                               </tr>  

                                <tr>
                                 <td>
                                    <label>
                                        <input type="checkbox" name="checkbox-0 "/>
                                    </label>
                                </td>
                                 <td>Smith</td> 
                                <td>Sampletitme</td> 
                                <td>open</td> 
                                <td>Yes</td> 
                                <td>me</td> 
                                    <td>me</td> 
                               </tr>  

                                <tr>
                                 <td>
                                    <label>
                                        <input type="checkbox" name="checkbox-0 "/>
                                    </label>
                                </td>
                                 <td>Smith</td> 
                                <td>Sampletitme</td> 
                                <td>open</td> 
                                <td>Yes</td> 
                                <td>me</td> 
                                    <td>me</td> 
                               </tr>  

                        </tbody>

                    </table>


推荐答案

当文档准备好时, :

$(document).ready(function() 
   { 
      $("#myTable").tablesorter(); 
   } 
); 

取自: Tablesorter文档

编辑,头部排序:

<link rel="stylesheet" href="../../Downloads/mine/jQueryMobile_resources/jquery.mobile-1.3.0.min.css" type="text/css">

<script type="text/javascript" src="js/jquery.jquery-latest.js" ></script> 
<script type="text/javascript" src="js/jquery.jquery.metadata.js" ></script> 

<script type="text/javascript" src="../../Downloads/mine/jQueryMobile_resources/jquery-  1.9.1.min.js"></script> 
<script type="text/javascript" src="../../Downloads/mine/jQueryMobile_resources/jquery.mobile-1.3.0.min.js"></script> 

 <script type="text/javascript" src="js/jquery.tablesorter.js" ></script> 


 <script type="text/javascript"> 
 $(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
  ); 

在浏览器中加载库,因此必须在任何JQuery插件之前加载JQuery

The order here reflects the order the libraries are loaded in the browser, so JQuery must be loaded before any plugins for JQuery

这篇关于在我的表中未启用排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆