Sorting not enable in my table

只谈情不闲聊 提交于 2019-12-25 05:06:14

问题


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

kindly resolve m issue.

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

I have updated the code below.

My Code:

<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>

回答1:


When using tablesorter did you call when document is ready?:

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

Taken from: Tablesorter docs

Edit, order in the head:

<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(); 
    } 
  ); 

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



来源:https://stackoverflow.com/questions/22860173/sorting-not-enable-in-my-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!