Hello,
I have an advanced search, which needs to be shown as an entitylist on the customer self service portal.
So I created a web template with custome code according to the layout provided in the link below:
I made some changes here and there in order to make it work as needed but there is one point left I can´t find a solution for: "sort"
I can see the arrows on the entitylist and when i click on them I see the URL changing (as expected by the code) but it woun´t sort my list.
Also: Using the "sort" function on "normal" entitylists (entitylist placed on a webpage without using custom code in web template) there is no changing URL.
So the function is implemented by another means.
Anyone achived to sort a entitylist generated by a fetchxml?
This should be the code for the sort function:
{% entityview id:params.view, search:params.search, order:params.order, page:params.page, pagesize:params.pagesize, metafilter:params.mf %}
{% assign order = params.order | default: entityview.sort_expression %}
<table class="table" data-order="{{ order }}">
<thead>
<tr>
{% for c in entityview.columns -%}
<th width="{{ c.width }}" data-logicalname="{{ c.logical_name }}">
{% if c.sort_enabled %}
{% assign current_sort = order | current_sort:c.logical_name %}
{% case current_sort %}
{% when 'ASC' %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}">
{{ c.name }} <i class="fa fa-sort-asc"></i>
</a>
{% when 'DESC' %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}">
{{ c.name }} <i class="fa fa-sort-desc"></i>
</a>
{% else %}
<a href="{{ request.path_and_query | add_query:'order', c.sort_ascending }}">
{{ c.name }} <i class="fa fa-unsorted"></i>
</a>
{% endcase %}
{% else %}
{{ c.name }}
{% endif %}
</th>
{% endfor -%}
<th width="1"></th>
</tr>
</thead>
Greetings
Roman







