0
這裏是圖像是我看到發生在我的表標題有人知道爲什麼嗎?
使用tablesorter 2.0看到asc和desc.gif圖像在我的列標題中顯示了一堆?
這裏是我的代碼: 我不明白爲什麼我看到7行箭頭。如果我點擊它也將顯示箭頭下來,功能然而所有的工作,我希望它只是顯示在正確的一個錯誤...
的style.css:
table.tablesorter thead tr .headerSortUp {
background-image: url(/tablesorter/img/asc.gif);
}
table.tablesorter thead tr .headerSortDown {
background-image: url(/tablesorter/img/desc.gif);
}
用戶表:
{{ HTML::style('/tablesorter/css/style.css'); }}
@if (Role::has('users.create'))
<div class="form-actions nomargin">
<a href="{{ route('user.create') }}">
<button class="btn btn-primary"><i class="icon-plus"></i> Add New User</button>
</a>
</div>
@endif
<div class="widget widget-table action-table">
<div class="widget-header"> <i class="icon-th-list"></i>
@if (Auth::user()->organization)
<h3>Users Under {{ Auth::user()->organization->name }}</h3>
@endif
</div>
<div class="widget-content">
@if($errors->has())
@foreach ($errors->all() as $error)
<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong>Error!</strong> {{ $error }}
</div>
@endforeach
@endif
<table id="myTable" class="table table-striped table-bordered tablesorter">
<thead>
<tr>
<th> Name </th>
<th> Title </th>
<th> User ID </th>
<th> Phone Number </th>
<th> Email </th>
<th class="td-actions"> </th>
<th class="td-actions"> </th>
</tr>
</thead>
<tbody>
@if (Auth::user()->organization)
@foreach (User::where('org_id', Auth::user()->organization->id)->get() as $user)
<tr>
<td> {{ $user->getFullName() }} </td>
<td> {{ $user->getRoleName() }} </td>
<td> {{ $user->id_custom }} </td>
<td> {{ $user->getPhoneFormatted() }} </td>
<td><a href="{{ $user->getEmailLink() }}" alt="Email {{ $user->getFullName() }}"><i class="btn-icon-only icon-envelope"></i></a> {{ $user->email }} </td>
@if (! Auth::user()->isImmuneFrom($user))
@if ($user->active == 1)
@if ($user->role == "manager" or $user->role == "ceo" or $user->role == "assist")
<td class="td-actions">
<a href="#myModal_edit_info_manager_ceo_assist" onclick="edit_info_manager_ceo_assist('{{ $user->fname }}', '{{ $user->lname }}', '{{ $user->getRoleName() }}', '{{ $user->id_custom }}', '{{ $user->phone }}', '{{ $user->email }}', '{{ $user->address1 }}', '{{ $user->address2 }}', '{{ $user->city }}', '{{ $user->state }}', '{{ $user->zip }}', '{{ $user->county }}', '{{ $user->id }}'); return false;" role="button" data-toggle="modal" class="btn btn-primary btn-small">
<i class="btn-icon-only"></i>
Edit User Information
</a>
</td>
@elseif ($user->role == "seller")
<td class="td-actions">
<a href="#myModal_edit_info_seller" onclick="edit_info_seller('{{ $user->fname }}', '{{ $user->lname }}', '{{ $user->getRoleName() }}', '{{ $user->id_custom }}', '{{ $user->phone }}', '{{ $user->email }}', '{{ $user->id }}'); return false;" role="button" data-toggle="modal" class="btn btn-primary btn-small">
<i class="btn-icon-only"></i>
Edit User Information
</a>
</td>
@endif
<td class="td-actions">
<a href="#myModal_deactivate" onclick="deactivate('{{ $user->getRoleName() }}', '{{ $user->getFullName() }}', {{ $user->id }}); return false;" role="button" data-toggle="modal" class="btn btn-danger btn-small">
<i class="btn-icon-only"></i>
Deactivate User
</a>
</td>
@else
<td class="td-actions"></td>
<td class="td-actions">
<a href="#myModal_reactivate" onclick="reactivate('{{ $user->getRoleName() }}', '{{ $user->getFullName() }}', {{ $user->id }}); return false;" role="button" data-toggle="modal" class="btn btn-success btn-small">
<i class="btn-icon-only"></i>
Reactivate User
</a>
</td>
@endif
@else
<td class="td-actions"></td>
<td class="td-actions"></td>
@endif
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
@section('javascript')
<script type="text/javascript" src="/tablesorter/jquery-latest.js"></script>
<script type="text/javascript" src="/tablesorter/jquery.tablesorter.js"></script>
@stop
@section('javascript_raw')
<script>
$(document).ready(function()
{
$("#myTable").tablesorter({sortList: [[0,0], [1,0]]});
}
);
</script>
@stop
我想我明白爲什麼有箭頭的7列,因爲我有七列。我也認爲它是因爲我的foreach循環?有沒有辦法做到這一點與foreach循環?每個專欄都需要一個箭頭,儘管有人知道爲什麼要這樣做嗎? – 2014-09-21 05:30:05
我可能會這麼大膽以至於建議你查看我的[fork of tablesorter](http://mottie.github.io/tablesorter/docs/)。它有很多增強功能,其中包括一堆默認主題。 – Mottie 2014-09-21 13:49:40