2013-07-25 4 views
2

jquery 데이터 테이블을 사용하고 있습니다.두 번째 행에 정렬 화살표 적용

테이블의 두 번째 행에 첫 번째가 아닌 정렬 화살표를 적용하고 싶습니다.

HTML : 내가 두 번째 행에있는 화살표를 원하는

enter image description here

:이처럼 보이는 것입니다

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

. 감사합니다

답변

2
// 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); 
+0

우수, 그 일부 형식 문제를 트릭을했지만 그들을 해결할 것입니다. 감사! – Beginner

+0

@Beginner - DataTable 플러그인은 기본적으로 적절한 클래스 및/또는 역할 속성을 사용해야 만 원하는대로 처리 할 수 ​​있습니다. https://datatables.net/release-datatables/examples/advanced_init/complex_header.html 예제 테이블에는 2 개의 헤더 행이 있지만 두 번째 행에만 정렬 요소가 있습니다. –