当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - apply sort arrows to the second row

问题描述:

I am using jquery data tables.

i want to have the sort arrows applied to the second row of the table not the first.

HTML:

<table id="tableUsers" class="datatable">

<thead>

<tr class="filterRow">

<td></td>

<td></td>

<td data-rownum="2">

@Html.Partial("_FilterDropDown", Model.RoleList)

</td>

<td></td>

<td></td>

<td></td>

<td data-rownum="8">

@Html.Partial("_FilterDropDown", Model.EnabledList)

</td>

<td></td>

<td></td>

</tr>

<tr>

<th class="width-110">User name

</th>

<th class="width-110">Name

</th>

<th class="width-110">Role

</th>

<th class="width-200">Email

</th>

<th class="width-90">Created

</th>

<th>DateSort

</th>

<th class="width-80">Enabled

</th>

<th class="width-90">Action

</th>

<th>EnabledSort

</th>

</tr>

</thead>

<tbody>

<tr>

<td></td>

</tr>

</tbody>

</table>

This is what it looks like:

I want the arrows on the second row. Thanks

网友答案:
// copy the filter row
var filterRow = $("#tableUsers .filterRow").clone();
// remove the filter row
$("#tableUsers .filterRow").remove();
// initialize the data table
$("#tableUsers").dataTable();
// re-add the filter row
$("#tableUsers thead tr:first").before(filterRow);
分享给朋友:
您可能感兴趣的文章:
随机阅读: