Skip to content

Commit

Permalink
Fix sort links
Browse files Browse the repository at this point in the history
Fix sort links to be able to work with route parameters
  • Loading branch information
aginev committed Sep 14, 2015
1 parent 09b463a commit 4d001c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Views/grid.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@if ($col->isAction() === false)
<th data-dg-col="{{ $col->getKey() }}" {!! $col->getAttributesHtml() !!}>
@if ($col->isSortable())
<a href="{{ url(\Route::getCurrentRoute()->getUri()) }}?{{ http_build_query($grid->getSortParams($col->getKey())) }}">{!! $col->getTitle() !!}<i class="glyphicon @if (\Input::get('f.order_by', '') == $col->getKey() && \Input::get('f.order_dir', 'ASC') == 'ASC') glyphicon-sort-by-attributes-alt @elseif (\Input::get('f.order_by', '') == $col->getKey() && \Input::get('f.order_dir', 'ASC') == 'DESC') glyphicon-sort-by-attributes @else glyphicon-sort @endif"></i></a>
<a href="{{ url(\Route::current()->getCompiled()->getStaticPrefix(), \Route::current()->parameters()) }}?{{ http_build_query($grid->getSortParams($col->getKey())) }}">{!! $col->getTitle() !!}<i class="glyphicon @if (\Input::get('f.order_by', '') == $col->getKey() && \Input::get('f.order_dir', 'ASC') == 'ASC') glyphicon-sort-by-attributes-alt @elseif (\Input::get('f.order_by', '') == $col->getKey() && \Input::get('f.order_dir', 'ASC') == 'DESC') glyphicon-sort-by-attributes @else glyphicon-sort @endif"></i></a>
@else
{{ $col->getTitle() }}
@endif
Expand Down Expand Up @@ -119,4 +119,4 @@
</div>
@endif

</div><!-- /.dg-wrapper -->
</div><!-- /.dg-wrapper -->

0 comments on commit 4d001c2

Please sign in to comment.