jQuery“tablesorterPager”不能在Asp.net MVC中工作

时间:2014-06-13 12:20:55

标签: jquery asp.net-mvc tablesorter

我在MVC中有动态HTML表格,如:

<table id="dt_basic" class="table dataTable">
      <thead style="text-align: left;">
            <tr>
                <th><i class="fa fa-lg fa-plus-circle"></i></th>
                <th style="text-align: left">Name</th>
                <th style="text-align: left">Resource Type</th>
                <th style="text-align: left">Week Start Date</th>
                <th style="text-align: left">Week End Date</th>
                <th style="text-align: left">Status</th>
            </tr>
     </thead>
     <tbody role="alert" aria-live="polite" aria-relevant="all">

          @foreach (var item in Model.GetContractorNotEnteredDetails)
              {
                <tr class="trList">
                   <td class="tdEmpId"><a class="text-success accordion-toggle ViewTimesheet" data-toggle="collapse" data-target="#demo1" id="view1" rel="@item.CONTR_ID"><i class="fa fa-lg fa-plus-circle"></i></a></td>
                   <td style="text-align: left">@Html.TextBoxFor(m => item.CONTRACTOR_NAME, new { @class = "project-input", @readonly = true, @style = "width:180px;text-align:left" })
                   <td style="text-align: left" class="tdResType">@Html.TextBoxFor(m => item.RES_TYPE, new { @class = "project-input", @readonly = true, @style = "text-align:left;" })</td>
                   <td style="text-align: left" class="tdStartDate">@Html.TextBoxFor(m => item.SDate, "{0:MM/dd/yyyy}", new { @class = "project-input startdate", @readonly = true })</td>
                   <td style="text-align: left" class="tdEndDate">@Html.TextBoxFor(m => item.EDate, "{0:MM/dd/yyyy}", new { @class = "project-input enddate", @readonly = true })</td>
                   <td style="text-align: left" class="tdStatus" title="@Html.DisplayFor(m => item.DESCR)"><span class="label-primary" style="color:white">&nbsp;&nbsp;@Html.DisplayFor(m => item.EMP_STATUS, new { @readonly = true, @style = "text-align:center;" })&nbsp;&nbsp;</span></td>

                   </tr>
       </tbody>
       <tfoot>
            <tr>
             <td> <div id="pager" class="pager" style="position: absolute; text-align: center;">
                  <img src="http://mottie.github.com/tablesorter/addons/pager/icons/first.png" class="first" />
                  <img src="http://mottie.github.com/tablesorter/addons/pager/icons/prev.png" class="prev" />
                  <span class="pagedisplay"></span>
                  <!-- this can be any element, including an input -->
                  <img rc="http://mottie.github.com/tablesorter/addons/pager/icons/next.png" class="next" />
                  <img src="http://mottie.github.com/tablesorter/addons/pager/icons/last.png" class="last" />
                 <select class="pagesize">
                   <option selected="selected" value="10">10</option>
                   <option value="20">20</option>
                   <option value="30">30</option>
                   <option value="40">40</option>
                   </select>
             </div>
          </td>
      </tr>
  </tfoot>
 </table>

应用排序和分页我引用了

<script src="~/Scripts/jquery-2.1.1.js"></script>
<script src="~/Scripts/jquery.tablesorter.js"></script>
<script src="~/Scripts/jquery.tablesorter.pager.js"></script>

并在我的视图中应用了脚本

    <script>
     $(document).ready(function () {

            $("#dt_basic")
            .tablesorter({ widthFixed: true, widgets: ['zebra'] })
            .tablesorterPager({ container: $("#pager") });
     });

   </script>

并实现分页和排序到&#34; dt_basic&#34;表,因为我已经写了上面的代码,但是不工作我的意思是它没有显示排序和分页,还有什么别的 去做。?

0 个答案:

没有答案
相关问题